2005-04-21 16:53:53 +02:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
2007-04-23 14:11:03 +02:00
|
|
|
.define __notify, __send, __senda, __sendnb, __receive, __sendrec
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-05-27 15:57:00 +02:00
|
|
|
! See src/kernel/ipc.h for C definitions
|
2005-04-21 16:53:53 +02:00
|
|
|
SEND = 1
|
|
|
|
RECEIVE = 2
|
2005-07-27 16:32:16 +02:00
|
|
|
SENDREC = 3
|
2005-07-29 17:01:59 +02:00
|
|
|
NOTIFY = 4
|
2007-04-23 14:11:03 +02:00
|
|
|
SENDNB = 5
|
|
|
|
SENDA = 16
|
2005-05-27 15:57:00 +02:00
|
|
|
SYSVEC = 33 ! trap to kernel
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-05-27 15:57:00 +02:00
|
|
|
SRC_DST = 8 ! source/ destination process
|
2007-04-23 14:11:03 +02:00
|
|
|
MSGTAB = 8 ! message table
|
2005-05-27 15:57:00 +02:00
|
|
|
MESSAGE = 12 ! message pointer
|
2007-04-23 14:11:03 +02:00
|
|
|
TABCOUNT = 12 ! number of entries in message table
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
!*========================================================================*
|
2005-05-27 15:57:00 +02:00
|
|
|
! IPC assembly routines *
|
2005-04-21 16:53:53 +02:00
|
|
|
!*========================================================================*
|
2005-05-27 15:57:00 +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
|
2005-05-27 15:57:00 +02:00
|
|
|
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
|
2005-05-27 15:57:00 +02:00
|
|
|
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
|
2005-05-27 15:57:00 +02:00
|
|
|
mov eax, SRC_DST(ebp) ! eax = dest-src
|
2005-04-21 16:53:53 +02:00
|
|
|
mov ebx, MESSAGE(ebp) ! ebx = message pointer
|
2005-05-30 13:11:40 +02:00
|
|
|
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
|
2005-05-19 11:36:44 +02:00
|
|
|
|
|
|
|
__notify:
|
2005-07-14 17:13:33 +02:00
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
push ebx
|
|
|
|
mov eax, SRC_DST(ebp) ! ebx = destination
|
2005-07-29 17:01:59 +02:00
|
|
|
mov ecx, NOTIFY ! _notify(srcdst)
|
2005-07-14 17:13:33 +02:00
|
|
|
int SYSVEC ! trap to the kernel
|
|
|
|
pop ebx
|
|
|
|
pop ebp
|
|
|
|
ret
|
|
|
|
|
2007-04-23 14:11:03 +02:00
|
|
|
__sendnb:
|
2005-05-27 15:57:00 +02:00
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
push ebx
|
2007-04-23 14:11:03 +02:00
|
|
|
mov eax, SRC_DST(ebp) ! eax = dest-src
|
|
|
|
mov ebx, MESSAGE(ebp) ! ebx = message pointer
|
|
|
|
mov ecx, SENDNB ! _sendnb(dest, ptr)
|
2005-05-27 15:57:00 +02:00
|
|
|
int SYSVEC ! trap to the kernel
|
|
|
|
pop ebx
|
|
|
|
pop ebp
|
|
|
|
ret
|
|
|
|
|
2007-04-23 14:11:03 +02:00
|
|
|
__senda:
|
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
push ebx
|
|
|
|
mov eax, TABCOUNT(ebp) ! eax = count
|
|
|
|
mov ebx, MSGTAB(ebp) ! ebx = table
|
|
|
|
mov ecx, SENDA ! _senda(table, count)
|
|
|
|
int SYSVEC ! trap to the kernel
|
|
|
|
pop ebx
|
|
|
|
pop ebp
|
|
|
|
ret
|