source: trunk/minix/lib/i386/rts/_ipcnew.s@ 9

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

Minix 3.1.2a

File size: 1.9 KB
Line 
1.sect .text; .sect .rom; .sect .data; .sect .bss
2.define __ipc_request, __ipc_reply, __ipc_notify, __ipc_receive
3
4! See src/kernel/ipc.h for C definitions.
5IPC_REQUEST = 16 ! each gets a distinct bit
6IPC_REPLY = 32
7IPC_NOTIFY = 64
8IPC_RECEIVE = 128
9
10SYSVEC = 33 ! trap to kernel
11
12! Offsets of arguments relative to stack pointer.
13SRC_DST = 8 ! source/ destination process
14SEND_MSG = 12 ! message pointer for sending
15EVENT_SET = 12 ! notification event set
16RECV_MSG = 16 ! message pointer for receiving
17
18
19!*========================================================================*
20! IPC assembly routines *
21!*========================================================================*
22! all message passing routines save ebp, but destroy eax, ecx, and edx.
23.define __ipc_request, __ipc_reply, __ipc_notify, __ipc_receive
24.sect .text
25
26__ipc_request:
27 push ebp
28 mov ebp, esp
29 push ebx
30 mov eax, SRC_DST(ebp) ! eax = destination
31 mov ebx, SEND_MSG(ebp) ! ebx = message pointer
32 mov ecx, IPC_REQUEST ! _ipc_request(dst, ptr)
33 int SYSVEC ! trap to the kernel
34 pop ebx
35 pop ebp
36 ret
37
38__ipc_reply:
39 push ebp
40 mov ebp, esp
41 push ebx
42 mov eax, SRC_DST(ebp) ! eax = destination
43 mov ebx, SEND_MSG(ebp) ! ebx = message pointer
44 mov ecx, IPC_REPLY ! _ipc_reply(dst, ptr)
45 int SYSVEC ! trap to the kernel
46 pop ebx
47 pop ebp
48 ret
49
50__ipc_receive:
51 push ebp
52 mov ebp, esp
53 push ebx
54 mov eax, SRC_DST(ebp) ! eax = source
55 mov edx, EVENT_SET(ebp) ! ebx = event set
56 mov ebx, RCV_MSG(ebp) ! ebx = message pointer
57 mov ecx, IPC_RECEIVE ! _ipc_receive(src, events, ptr)
58 int SYSVEC ! trap to the kernel
59 pop ebx
60 pop ebp
61 ret
62
63__ipc_notify:
64 push ebp
65 mov ebp, esp
66 push ebx
67 mov eax, SRC_DST(ebp) ! ebx = destination
68 mov edx, EVENT_SET(ebp) ! edx = event set
69 mov ecx, IPC_NOTIFY ! _ipc_notify(dst, events)
70 int SYSVEC ! trap to the kernel
71 pop ebx
72 pop ebp
73 ret
74
75
Note: See TracBrowser for help on using the repository browser.