From: Arun Thomas Date: Sun, 26 Aug 2012 16:44:27 +0000 (-0400) Subject: machine/ipcconst.h for arch-specific constants X-Git-Tag: v3.2.1~356 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.3.html?a=commitdiff_plain;h=9a9d555f56854b4a0d22ac8595ab2db4e9438c81;p=minix.git machine/ipcconst.h for arch-specific constants --- diff --git a/include/arch/i386/include/Makefile b/include/arch/i386/include/Makefile index c8cbe69fd..bdc3a7365 100644 --- a/include/arch/i386/include/Makefile +++ b/include/arch/i386/include/Makefile @@ -14,7 +14,7 @@ INCS= ansi.h asm.h bswap.h byte_swap.h cdefs.h \ interrupt.h memory.h multiboot.h partition.h \ pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \ ports.h stackframe.h vm.h elf.h elf_machdep.h mutex.h \ - disklabel.h + disklabel.h ipcconst.h .include diff --git a/include/arch/i386/include/ipcconst.h b/include/arch/i386/include/ipcconst.h new file mode 100644 index 000000000..56cc3046b --- /dev/null +++ b/include/arch/i386/include/ipcconst.h @@ -0,0 +1,9 @@ +#ifndef _I386_IPCCONST_H_ +#define _I386_IPCCONST_H_ + +#define KERVEC 32 /* syscall trap to kernel */ +#define IPCVEC 33 /* ipc trap to kernel */ + +#define IPC_STATUS_REG bx + +#endif /* _I386_IPCCONST_H_ */ diff --git a/include/minix/ipcconst.h b/include/minix/ipcconst.h index 8dfddd93a..d8202bcdc 100644 --- a/include/minix/ipcconst.h +++ b/include/minix/ipcconst.h @@ -1,6 +1,8 @@ #ifndef _IPC_CONST_H #define _IPC_CONST_H +#include + /* System call numbers that are passed when trapping to the kernel. */ #define SEND 1 /* blocking send */ #define RECEIVE 2 /* blocking receive */ diff --git a/kernel/ipc.h b/kernel/ipc.h index 3007a7032..a62919eb9 100644 --- a/kernel/ipc.h +++ b/kernel/ipc.h @@ -5,6 +5,7 @@ * These definitions are used in the file proc.c. */ #include +#include /* Masks and flags for system calls. */ #define NON_BLOCKING 0x0080 /* do not block if target not ready */ @@ -15,7 +16,6 @@ (target->p_getfrom_e == ANY || target->p_getfrom_e == source_ep)) /* IPC status code macros. */ -#define IPC_STATUS_REG bx #define IPC_STATUS_GET(p) ((p)->p_reg.IPC_STATUS_REG) #define IPC_STATUS_CLEAR(p) ((p)->p_reg.IPC_STATUS_REG = 0) diff --git a/lib/libc/arch/i386/sys-minix/_ipc.S b/lib/libc/arch/i386/sys-minix/_ipc.S index 9bfa326f3..4e828d749 100644 --- a/lib/libc/arch/i386/sys-minix/_ipc.S +++ b/lib/libc/arch/i386/sys-minix/_ipc.S @@ -1,9 +1,6 @@ #include #include - IPCVEC = 33 /* ipc trap to kernel */ - KERVEC = 32 /* syscall trap to kernel */ - SRC_DST = 8 /* source/ destination process */ MESSAGE = 12 /* message pointer */ STATUS = 16 /* status pointer */ diff --git a/lib/libc/arch/i386/sys-minix/_senda.S b/lib/libc/arch/i386/sys-minix/_senda.S index a38c2c9fc..9a2cb6d81 100644 --- a/lib/libc/arch/i386/sys-minix/_senda.S +++ b/lib/libc/arch/i386/sys-minix/_senda.S @@ -1,8 +1,6 @@ #include #include - SYSVEC = 33 - MSGTAB = 8 /* message table */ TABCOUNT = 12 /* number of entries in message table */ @@ -13,7 +11,7 @@ ENTRY(_senda) movl TABCOUNT(%ebp), %eax /* eax = count */ movl MSGTAB(%ebp), %ebx /* ebx = table */ movl $SENDA, %ecx /* _senda(table, count) */ - int $SYSVEC /* trap to the kernel */ + int $IPCVEC /* trap to the kernel */ pop %ebx pop %ebp ret