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 .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 ! See src/kernel/ipc.h for C definitions
SEND = 1 SEND = 1
RECEIVE = 2 RECEIVE = 2
SENDREC = 3 SENDREC = 3
NOTIFY = 16 NOTIFY = 4
ALERT = 4
ECHO = 8 ECHO = 8
NB_SEND = 1 + 16 ! flags 0x10 to prevent blocking NB_SEND = 1 + 16 ! flags 0x10 to prevent blocking
NB_RECEIVE = 2 + 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 * ! IPC assembly routines *
!*========================================================================* !*========================================================================*
! all message passing routines save ebp, but destroy eax and ecx. ! 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 .sect .text
__send: __send:
push ebp push ebp
@ -83,23 +82,11 @@ __sendrec:
ret ret
__notify: __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 push ebp
mov ebp, esp mov ebp, esp
push ebx push ebx
mov eax, SRC_DST(ebp) ! ebx = destination mov eax, SRC_DST(ebp) ! ebx = destination
mov ecx, ALERT ! _alert(srcdst) mov ecx, NOTIFY ! _notify(srcdst)
int SYSVEC ! trap to the kernel int SYSVEC ! trap to the kernel
pop ebx pop ebx
pop ebp pop ebp

View file

@ -1,9 +1,8 @@
#include "syslib.h" #include "syslib.h"
PUBLIC int sys_fork(parent, child, pid) PUBLIC int sys_fork(parent, child)
int parent; /* process doing the fork */ int parent; /* process doing the fork */
int child; /* which proc has been created by 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. */ /* 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_PPROC_NR = parent;
m.PR_PROC_NR = child; m.PR_PROC_NR = child;
m.PR_PID = pid;
return(_taskcall(SYSTASK, SYS_FORK, &m)); return(_taskcall(SYSTASK, SYS_FORK, &m));
} }

View file

@ -1,6 +1,6 @@
#include "syslib.h" #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. */ /* Zero a block of data. */
message mess; 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_PTR = (char *) base;
mess.MEM_COUNT = bytes; mess.MEM_COUNT = bytes;
mess.MEM_PATTERN = c; mess.MEM_PATTERN = pattern;
return(_taskcall(SYSTASK, SYS_MEMSET, &mess)); return(_taskcall(SYSTASK, SYS_MEMSET, &mess));
} }

View file

@ -3,8 +3,7 @@
/*===========================================================================* /*===========================================================================*
* sys_setalarm * * sys_setalarm *
*===========================================================================*/ *===========================================================================*/
PUBLIC int sys_setalarm(proc_nr, exp_time, abs_time) PUBLIC int sys_setalarm(exp_time, abs_time)
int proc_nr; /* process to send SYN_ALARM message to */
clock_t exp_time; /* expiration time for the alarm */ clock_t exp_time; /* expiration time for the alarm */
int abs_time; /* use absolute or relative expiration time */ 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. * number can be SELF if the caller doesn't know its process number.
*/ */
message m; message m;
m.ALRM_PROC_NR = proc_nr; /* receiving process */
m.ALRM_EXP_TIME = exp_time; /* the expiration time */ m.ALRM_EXP_TIME = exp_time; /* the expiration time */
m.ALRM_ABS_TIME = abs_time; /* time is absolute? */ m.ALRM_ABS_TIME = abs_time; /* time is absolute? */
return _taskcall(SYSTASK, SYS_SETALARM, &m); return _taskcall(SYSTASK, SYS_SETALARM, &m);

View file

@ -3,17 +3,15 @@
/*===========================================================================* /*===========================================================================*
* sys_sigreturn * * 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 */ int proc_nr; /* for which process */
struct sigmsg *sig_ctxt; /* POSIX style handling */ struct sigmsg *sig_ctxt; /* POSIX style handling */
int flags; /* flags for POSIX handling */
{ {
message m; message m;
int result; int result;
m.SIG_PROC = proc_nr; m.SIG_PROC = proc_nr;
m.SIG_CTXT_PTR = (char *) sig_ctxt; m.SIG_CTXT_PTR = (char *) sig_ctxt;
m.SIG_FLAGS = flags;
result = _taskcall(SYSTASK, SYS_SIGRETURN, &m); result = _taskcall(SYSTASK, SYS_SIGRETURN, &m);
return(result); return(result);
} }