Updates system library calls: interface changes (removed unused parameters).

Removed old notification trap: renamed alert() to notify() ... finally ;-)
This commit is contained in:
Jorrit Herder 2005-07-29 15:01:59 +00:00
parent d3874a7917
commit 748b3dd434
5 changed files with 9 additions and 29 deletions

View file

@ -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

View file

@ -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));
}

View file

@ -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));
}

View file

@ -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);

View file

@ -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);
}