source: trunk/minix/lib/i386/rts/_ipc.s@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.7 KB
RevLine 
[9]1.sect .text; .sect .rom; .sect .data; .sect .bss
2.define __echo, __notify, __send, __receive, __sendrec
3
4! See src/kernel/ipc.h for C definitions
5SEND = 1
6RECEIVE = 2
7SENDREC = 3
8NOTIFY = 4
9ECHO = 8
10SYSVEC = 33 ! trap to kernel
11
12SRC_DST = 8 ! source/ destination process
13ECHO_MESS = 8 ! echo doesn't have SRC_DST
14MESSAGE = 12 ! message pointer
15
16!*========================================================================*
17! IPC assembly routines *
18!*========================================================================*
19! all message passing routines save ebp, but destroy eax and ecx.
20.define __echo, __notify, __send, __receive, __sendrec
21.sect .text
22__send:
23 push ebp
24 mov ebp, esp
25 push ebx
26 mov eax, SRC_DST(ebp) ! eax = dest-src
27 mov ebx, MESSAGE(ebp) ! ebx = message pointer
28 mov ecx, SEND ! _send(dest, ptr)
29 int SYSVEC ! trap to the kernel
30 pop ebx
31 pop ebp
32 ret
33
34__receive:
35 push ebp
36 mov ebp, esp
37 push ebx
38 mov eax, SRC_DST(ebp) ! eax = dest-src
39 mov ebx, MESSAGE(ebp) ! ebx = message pointer
40 mov ecx, RECEIVE ! _receive(src, ptr)
41 int SYSVEC ! trap to the kernel
42 pop ebx
43 pop ebp
44 ret
45
46__sendrec:
47 push ebp
48 mov ebp, esp
49 push ebx
50 mov eax, SRC_DST(ebp) ! eax = dest-src
51 mov ebx, MESSAGE(ebp) ! ebx = message pointer
52 mov ecx, SENDREC ! _sendrec(srcdest, ptr)
53 int SYSVEC ! trap to the kernel
54 pop ebx
55 pop ebp
56 ret
57
58__notify:
59 push ebp
60 mov ebp, esp
61 push ebx
62 mov eax, SRC_DST(ebp) ! ebx = destination
63 mov ecx, NOTIFY ! _notify(srcdst)
64 int SYSVEC ! trap to the kernel
65 pop ebx
66 pop ebp
67 ret
68
69__echo:
70 push ebp
71 mov ebp, esp
72 push ebx
73 mov ebx, ECHO_MESS(ebp) ! ebx = message pointer
74 mov ecx, ECHO ! _echo(srcdest, ptr)
75 int SYSVEC ! trap to the kernel
76 pop ebx
77 pop ebp
78 ret
79
Note: See TracBrowser for help on using the repository browser.