1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
#include <minix/ipcconst.h>
#include <machine/asm.h>
SRC_DST = 8 /* source/ destination process */
MESSAGE = 12 /* message pointer */
STATUS = 16 /* status pointer */
/* For _ipc_senda() */
MSGTAB = 8 /* message table */
TABCOUNT = 12 /* number of entries in message table */
/**========================================================================* */
/* IPC assembly routines * */
/**========================================================================* */
/* all message passing routines save ebx, but destroy eax and ecx. */
ENTRY(_ipc_send_intr)
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 /* _ipc_send(dest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_receive_intr)
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 /* _ipc_receive(src, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
movl STATUS(%ebp), %ecx /* ecx = status pointer */
movl %ebx, (%ecx)
pop %ebx
pop %ebp
ret
ENTRY(_ipc_sendrec_intr)
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 /* _ipc_sendrec(srcdest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_notify_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = destination */
movl $NOTIFY, %ecx /* _ipc_notify(srcdst) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_sendnb_intr)
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 /* _ipc_sendnb(dest, ptr) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_ipc_senda_intr)
push %ebp
movl %esp, %ebp
push %ebx
movl TABCOUNT(%ebp), %eax /* eax = count */
movl MSGTAB(%ebp), %ebx /* ebx = table */
movl $SENDA, %ecx /* _ipc_senda(table, count) */
int $IPCVEC_INTR /* trap to the kernel */
pop %ebx
pop %ebp
ret
|