正在加载图片...
C数据类型及变量声明示例 78 79 sys_call 6 81 PUBLIC int sys_call(call_nr,src_dst,m_ptr) int call_nr; /system call number and flags * 83 int src_dst; /src to receive from or dst to send to * 4 message *m_ptr; /pointer to message in the caller's space 85( 86 /System calls are done by trapping to the kernel with an INT instruction. 87 The trap is caught and sys_call()is called to send or receive a message 88 *(or both).The caller is always given by 'proc_ptr'. 89 98 register struct proc *caller_ptr proc_ptr;/get pointer to caiter * int function call_nr SYSCALL_FUNC;/get system call function 92 unsigned flags call_nr SYSCALL_FLAGS;/get flags 93 int mask_entry; /*bit to check in send mask 94 int result; /*the system call's result vir clicks vlo,vhi; /virtual clicks containing message to sond * 96 97 /*Check if the process has privileges for the requested call.Calls to the 98 kernel may only be SENDREC,because tasks always reply and may not block 99 if the caller doesn't do receive(). 100 / 101 if ((priv(caller_ptr)->s_trap_mask &(1 <function)) 10/43C 数据类型及变量声明示例 10 / 43
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有