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
|
|
|
|
|
|
|
IPCVEC = 33 /* ipc trap to kernel */
|
|
|
|
KERVEC = 32 /* syscall trap to kernel */
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
/**========================================================================* */
|
|
|
|
/* IPC assembly routines * */
|
|
|
|
/**========================================================================* */
|
2010-03-23 01:09:11 +01:00
|
|
|
/* all message passing routines save ebx, but destroy eax and ecx. */
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_send)
|
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 */
|
|
|
|
movl $SEND, %ecx /* _send(dest, ptr) */
|
|
|
|
int $IPCVEC /* trap to the kernel */
|
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_receive)
|
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 */
|
|
|
|
movl $RECEIVE, %ecx /* _receive(src, ptr) */
|
|
|
|
int $IPCVEC /* 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
|
|
|
|
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_sendrec)
|
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 */
|
|
|
|
movl $SENDREC, %ecx /* _sendrec(srcdest, ptr) */
|
|
|
|
int $IPCVEC /* trap to the kernel */
|
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_notify)
|
2010-03-03 15:27:30 +01:00
|
|
|
push %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
push %ebx
|
|
|
|
movl SRC_DST(%ebp), %eax /* eax = destination */
|
|
|
|
movl $NOTIFY, %ecx /* _notify(srcdst) */
|
|
|
|
int $IPCVEC /* trap to the kernel */
|
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_sendnb)
|
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 */
|
|
|
|
movl $SENDNB, %ecx /* _sendnb(dest, ptr) */
|
|
|
|
int $IPCVEC /* trap to the kernel */
|
|
|
|
pop %ebx
|
|
|
|
pop %ebp
|
|
|
|
ret
|
|
|
|
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(_do_kernel_call)
|
2010-03-03 15:27:30 +01:00
|
|
|
/* pass the message pointer to kernel in the %eax register */
|
|
|
|
movl 4(%esp), %eax
|
|
|
|
int $KERVEC
|
|
|
|
ret
|