2010-03-23 01:09:11 +01:00
|
|
|
#include <minix/ipcconst.h>
|
2010-08-17 18:44:07 +02:00
|
|
|
#include <machine/asm.h>
|
2010-03-03 15:27:30 +01:00
|
|
|
|
|
|
|
SRC_DST = 8 /* source/ destination process */
|
|
|
|
MESSAGE = 12 /* message pointer */
|
2010-03-23 01:09:11 +01:00
|
|
|
STATUS = 16 /* status pointer */
|
2010-03-03 15:27:30 +01:00
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
/* For _ipc_senda() */
|
|
|
|
MSGTAB = 8 /* message table */
|
|
|
|
TABCOUNT = 12 /* number of entries in message table */
|
|
|
|
|
2010-03-03 15:27:30 +01:00
|
|
|
/**========================================================================* */
|
|
|
|
/* IPC assembly routines * */
|
|
|
|
/**========================================================================* */
|
2010-03-23 01:09:11 +01:00
|
|
|
/* all message passing routines save ebx, but destroy eax and ecx. */
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_send_intr)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
|
|
|
movl SRC_DST(%ebp), %eax /* eax = dest-src */
|
|
|
|
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
|
2013-11-01 13:34:14 +01:00
|
|
|
movl $SEND, %ecx /* _ipc_send(dest, ptr) */
|
|
|
|
int $IPCVEC_INTR /* trap to the kernel */
|
2010-03-03 15:27:30 +01:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_receive_intr)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
|
|
|
movl SRC_DST(%ebp), %eax /* eax = dest-src */
|
|
|
|
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
|
2013-11-01 13:34:14 +01:00
|
|
|
movl $RECEIVE, %ecx /* _ipc_receive(src, ptr) */
|
|
|
|
int $IPCVEC_INTR /* trap to the kernel */
|
2010-03-23 01:09:11 +01:00
|
|
|
movl STATUS(%ebp), %ecx /* ecx = status pointer */
|
|
|
|
movl %ebx, (%ecx)
|
2010-03-03 15:27:30 +01:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_sendrec_intr)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
|
|
|
movl SRC_DST(%ebp), %eax /* eax = dest-src */
|
|
|
|
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
|
2013-11-01 13:34:14 +01:00
|
|
|
movl $SENDREC, %ecx /* _ipc_sendrec(srcdest, ptr) */
|
|
|
|
int $IPCVEC_INTR /* trap to the kernel */
|
2010-03-03 15:27:30 +01:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_notify_intr)
|
2012-07-18 18:53:20 +02:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
2013-11-01 13:34:14 +01:00
|
|
|
movl SRC_DST(%ebp), %eax /* eax = destination */
|
|
|
|
movl $NOTIFY, %ecx /* _ipc_notify(srcdst) */
|
|
|
|
int $IPCVEC_INTR /* trap to the kernel */
|
2012-07-18 18:53:20 +02:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_sendnb_intr)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
2013-11-01 13:34:14 +01:00
|
|
|
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 */
|
2010-03-03 15:27:30 +01:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2013-11-01 13:34:14 +01:00
|
|
|
ENTRY(_ipc_senda_intr)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
2013-11-01 13:34:14 +01:00
|
|
|
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 */
|
2010-03-03 15:27:30 +01:00
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|