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