minix/lib/i386/rts/_ipc.s

80 lines
1.7 KiB
ArmAsm
Raw Normal View History

2005-04-21 16:53:53 +02:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.define __notify, __send, __senda, __sendnb, __receive, __sendrec
2005-04-21 16:53:53 +02:00
! See src/kernel/ipc.h for C definitions
2005-04-21 16:53:53 +02:00
SEND = 1
RECEIVE = 2
SENDREC = 3
NOTIFY = 4
SENDNB = 5
SYSVEC = 33 ! trap to kernel
2005-04-21 16:53:53 +02:00
SRC_DST = 8 ! source/ destination process
MESSAGE = 12 ! message pointer
2005-04-21 16:53:53 +02:00
!*========================================================================*
! IPC assembly routines *
2005-04-21 16:53:53 +02:00
!*========================================================================*
! all message passing routines save ebp, but destroy eax and ecx.
2005-04-21 16:53:53 +02:00
.sect .text
__send:
push ebp
mov ebp, esp
push ebx
mov eax, SRC_DST(ebp) ! eax = dest-src
2005-04-21 16:53:53 +02:00
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SEND ! _send(dest, ptr)
int SYSVEC ! trap to the kernel
pop ebx
pop ebp
ret
__receive:
push ebp
mov ebp, esp
push ebx
mov eax, SRC_DST(ebp) ! eax = dest-src
2005-04-21 16:53:53 +02:00
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, RECEIVE ! _receive(src, ptr)
int SYSVEC ! trap to the kernel
pop ebx
pop ebp
ret
__sendrec:
push ebp
mov ebp, esp
push ebx
mov eax, SRC_DST(ebp) ! eax = dest-src
2005-04-21 16:53:53 +02:00
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SENDREC ! _sendrec(srcdest, ptr)
2005-04-21 16:53:53 +02:00
int SYSVEC ! trap to the kernel
pop ebx
pop ebp
ret
__notify:
push ebp
mov ebp, esp
push ebx
2009-09-02 23:55:26 +02:00
mov eax, SRC_DST(ebp) ! eax = destination
mov ecx, NOTIFY ! _notify(srcdst)
int SYSVEC ! trap to the kernel
pop ebx
pop ebp
ret
__sendnb:
push ebp
mov ebp, esp
push ebx
mov eax, SRC_DST(ebp) ! eax = dest-src
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SENDNB ! _sendnb(dest, ptr)
int SYSVEC ! trap to the kernel
pop ebx
pop ebp
ret
2008-12-11 15:37:02 +01:00