From: Ben Gras Date: Wed, 15 Mar 2006 11:29:54 +0000 (+0000) Subject: Hack out of proc.c; function and flags width in ipc.h back to nibbles X-Git-Tag: v3.1.2a~237 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/index.html?a=commitdiff_plain;h=55bdde85f0165bffca6e3167ae375f5801304005;p=minix.git Hack out of proc.c; function and flags width in ipc.h back to nibbles instead of bytes for backwards compatability --- diff --git a/kernel/ipc.h b/kernel/ipc.h index 8bd910428..b5dffdeaa 100644 --- a/kernel/ipc.h +++ b/kernel/ipc.h @@ -7,24 +7,24 @@ #include /* Masks and flags for system calls. */ -#define SYSCALL_FUNC 0x00FF /* mask for system call function */ -#define SYSCALL_FLAGS 0xFF00 /* mask for system call flags */ -#define NON_BLOCKING 0x0100 /* do not block if target not ready */ +#define SYSCALL_FUNC 0x000F /* mask for system call function */ +#define SYSCALL_FLAGS 0x00F0 /* mask for system call flags */ +#define NON_BLOCKING 0x0010 /* do not block if target not ready */ /* System call numbers that are passed when trapping to the kernel. The * numbers are carefully defined so that it can easily be seen (based on * the bits that are on) which checks should be done in sys_call(). */ -#define SEND 1 /* 0000 0001 : blocking send */ -#define RECEIVE 2 /* 0000 0010 : blocking receive */ -#define SENDREC 3 /* 0000 0011 : SEND + RECEIVE */ -#define NOTIFY 4 /* 0000 0100 : nonblocking notify */ -#define ECHO 8 /* 0000 1000 : echo a message */ +#define SEND 1 /* 0001 : blocking send */ +#define RECEIVE 2 /* 0010 : blocking receive */ +#define SENDREC 3 /* 0011 : SEND + RECEIVE */ +#define NOTIFY 4 /* 0100 : nonblocking notify */ +#define ECHO 8 /* 1000 : echo a message */ -#define IPC_REQUEST 0x10 /* 0001 0000 : blocking request */ -#define IPC_REPLY 0x20 /* 0010 0000 : nonblocking reply */ -#define IPC_NOTIFY 0x40 /* 0100 0000 : nonblocking notification */ -#define IPC_RECEIVE 0x80 /* 1000 0000 : blocking receive */ +#define IPC_REQUEST 5 /* 0101 : blocking request */ +#define IPC_REPLY 6 /* 0110 : nonblocking reply */ +#define IPC_NOTIFY 7 /* 0111 : nonblocking notification */ +#define IPC_RECEIVE 9 /* 1001 : blocking receive */ /* The following bit masks determine what checks that should be done. */ #define CHECK_PTR 0xBB /* 1011 1011 : validate message buffer */ diff --git a/kernel/proc.c b/kernel/proc.c index 2639ddb2f..2635d299d 100755 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -101,19 +101,14 @@ long bit_map; /* notification event set or flags */ * (or both). The caller is always given by 'proc_ptr'. */ register struct proc *caller_ptr = proc_ptr; /* get pointer to caller */ - int function; /* get system call function */ - unsigned flags; /* get flags */ + int function = call_nr & SYSCALL_FUNC; /* get system call function */ + unsigned flags = call_nr & SYSCALL_FLAGS; /* get flags */ int mask_entry; /* bit to check in send mask */ int group_size; /* used for deadlock check */ int result; /* the system call's result */ int src_dst; vir_clicks vlo, vhi; /* virtual clicks containing message to send */ - if(call_nr == 0x23) call_nr = 0x0203; - - function = call_nr & SYSCALL_FUNC; /* get system call function */ - flags = call_nr & SYSCALL_FLAGS; /* get flags */ - #if 0 if (caller_ptr->p_rts_flags & SLOT_FREE) {