From: Jorrit Herder Date: Fri, 29 Jul 2005 15:01:59 +0000 (+0000) Subject: Updates system library calls: interface changes (removed unused parameters). X-Git-Tag: v3.1.0~494 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch09.html?a=commitdiff_plain;h=748b3dd434a375e58e51bf99e1715f5518041b9b;p=minix.git Updates system library calls: interface changes (removed unused parameters). Removed old notification trap: renamed alert() to notify() ... finally ;-) --- diff --git a/lib/i386/rts/_ipc.s b/lib/i386/rts/_ipc.s index a1993f47a..4d9191a08 100755 --- a/lib/i386/rts/_ipc.s +++ b/lib/i386/rts/_ipc.s @@ -1,12 +1,11 @@ .sect .text; .sect .rom; .sect .data; .sect .bss -.define __echo, __alert, __send, __nb_send, __receive, __nb_receive, __sendrec, __notify +.define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec ! See src/kernel/ipc.h for C definitions SEND = 1 RECEIVE = 2 SENDREC = 3 -NOTIFY = 16 -ALERT = 4 +NOTIFY = 4 ECHO = 8 NB_SEND = 1 + 16 ! flags 0x10 to prevent blocking NB_RECEIVE = 2 + 16 ! flags 0x10 to prevent blocking @@ -20,7 +19,7 @@ MESSAGE = 12 ! message pointer ! IPC assembly routines * !*========================================================================* ! all message passing routines save ebp, but destroy eax and ecx. -.define __echo, __alert, __send, __nb_send, __receive, __nb_receive, __sendrec, __notify +.define __echo, __notify, __send, __nb_send, __receive, __nb_receive, __sendrec .sect .text __send: push ebp @@ -83,23 +82,11 @@ __sendrec: ret __notify: - push ebp - mov ebp, esp - push ebx - mov eax, SRC_DST(ebp) ! eax = dest-src - mov ebx, MESSAGE(ebp) ! ebx = message pointer - mov ecx, NOTIFY ! _notify(srcdest, ptr) - int SYSVEC ! trap to the kernel - pop ebx - pop ebp - ret - -__alert: push ebp mov ebp, esp push ebx mov eax, SRC_DST(ebp) ! ebx = destination - mov ecx, ALERT ! _alert(srcdst) + mov ecx, NOTIFY ! _notify(srcdst) int SYSVEC ! trap to the kernel pop ebx pop ebp diff --git a/lib/syslib/sys_fork.c b/lib/syslib/sys_fork.c index f57aaa3e7..b93734491 100755 --- a/lib/syslib/sys_fork.c +++ b/lib/syslib/sys_fork.c @@ -1,9 +1,8 @@ #include "syslib.h" -PUBLIC int sys_fork(parent, child, pid) +PUBLIC int sys_fork(parent, child) int parent; /* process doing the fork */ int child; /* which proc has been created by the fork */ -int pid; /* process id assigned by MM */ { /* A process has forked. Tell the kernel. */ @@ -11,6 +10,5 @@ int pid; /* process id assigned by MM */ m.PR_PPROC_NR = parent; m.PR_PROC_NR = child; - m.PR_PID = pid; return(_taskcall(SYSTASK, SYS_FORK, &m)); } diff --git a/lib/syslib/sys_memset.c b/lib/syslib/sys_memset.c index c1c98ab11..b0755f983 100644 --- a/lib/syslib/sys_memset.c +++ b/lib/syslib/sys_memset.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_memset(char c, phys_bytes base, phys_bytes bytes) +PUBLIC int sys_memset(unsigned long pattern, phys_bytes base, phys_bytes bytes) { /* Zero a block of data. */ message mess; @@ -9,7 +9,7 @@ PUBLIC int sys_memset(char c, phys_bytes base, phys_bytes bytes) mess.MEM_PTR = (char *) base; mess.MEM_COUNT = bytes; - mess.MEM_PATTERN = c; + mess.MEM_PATTERN = pattern; return(_taskcall(SYSTASK, SYS_MEMSET, &mess)); } diff --git a/lib/syslib/sys_setalarm.c b/lib/syslib/sys_setalarm.c index 9b2bc5d8e..50f330271 100644 --- a/lib/syslib/sys_setalarm.c +++ b/lib/syslib/sys_setalarm.c @@ -3,8 +3,7 @@ /*===========================================================================* * sys_setalarm * *===========================================================================*/ -PUBLIC int sys_setalarm(proc_nr, exp_time, abs_time) -int proc_nr; /* process to send SYN_ALARM message to */ +PUBLIC int sys_setalarm(exp_time, abs_time) clock_t exp_time; /* expiration time for the alarm */ int abs_time; /* use absolute or relative expiration time */ { @@ -12,8 +11,6 @@ int abs_time; /* use absolute or relative expiration time */ * number can be SELF if the caller doesn't know its process number. */ message m; - - m.ALRM_PROC_NR = proc_nr; /* receiving process */ m.ALRM_EXP_TIME = exp_time; /* the expiration time */ m.ALRM_ABS_TIME = abs_time; /* time is absolute? */ return _taskcall(SYSTASK, SYS_SETALARM, &m); diff --git a/lib/syslib/sys_sigreturn.c b/lib/syslib/sys_sigreturn.c index 57afdf4d1..445c45198 100755 --- a/lib/syslib/sys_sigreturn.c +++ b/lib/syslib/sys_sigreturn.c @@ -3,17 +3,15 @@ /*===========================================================================* * sys_sigreturn * *===========================================================================*/ -PUBLIC int sys_sigreturn(proc_nr, sig_ctxt, flags) +PUBLIC int sys_sigreturn(proc_nr, sig_ctxt) int proc_nr; /* for which process */ struct sigmsg *sig_ctxt; /* POSIX style handling */ -int flags; /* flags for POSIX handling */ { message m; int result; m.SIG_PROC = proc_nr; m.SIG_CTXT_PTR = (char *) sig_ctxt; - m.SIG_FLAGS = flags; result = _taskcall(SYSTASK, SYS_SIGRETURN, &m); return(result); }