minix/lib/libc/arch/i386/sys-minix/_ipc.S
Lionel Sambuc c3fc9df84a Adding ipc_ prefix to ipc primitives
* Also change _orig to _intr for clarity
 * Cleaned up {IPC,KER}VEC
 * Renamed _minix_kernel_info_struct to get_minix_kerninfo
 * Merged _senda.S into _ipc.S
 * Moved into separate files get_minix_kerninfo and _do_kernel_call
 * Adapted do_kernel_call to follow same _ convention as ipc functions
 * Drop patches in libc/net/send.c and libc/include/namespace.h

Change-Id: If4ea21ecb65435170d7d87de6c826328e84c18d0
2014-03-01 09:05:01 +01:00

89 lines
2.2 KiB
ArmAsm

#include <minix/ipcconst.h>
#include <machine/asm.h>
SRC_DST = 8 /* source/ destination process */
MESSAGE = 12 /* message pointer */
STATUS = 16 /* status pointer */
/* For _ipc_senda() */
MSGTAB = 8 /* message table */
TABCOUNT = 12 /* number of entries in message table */
/**========================================================================* */
/* IPC assembly routines * */
/**========================================================================* */
/* all message passing routines save ebx, but destroy eax and ecx. */
ENTRY(_ipc_send_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SEND, %ecx /* _ipc_send(dest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_receive_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $RECEIVE, %ecx /* _ipc_receive(src, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
movl STATUS(%ebp), %ecx /* ecx = status pointer */
movl %ebx, (%ecx)
pop %ebx
pop %ebp
ret
ENTRY(_ipc_sendrec_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SENDREC, %ecx /* _ipc_sendrec(srcdest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_notify_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = destination */
movl $NOTIFY, %ecx /* _ipc_notify(srcdst) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_sendnb_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SENDNB, %ecx /* _ipc_sendnb(dest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_senda_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl TABCOUNT(%ebp), %eax /* eax = count */
movl MSGTAB(%ebp), %ebx /* ebx = table */
movl $SENDA, %ecx /* _ipc_senda(table, count) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret