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