2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 * Carnegie Mellon requests users of this software to return to
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
26 * from: Mach, Revision 2.7 92/02/29 15:33:41 rpd
30 #define S_ARG0 4(%esp)
31 #define S_ARG1 8(%esp)
32 #define S_ARG2 12(%esp)
33 #define S_ARG3 16(%esp)
35 #define FRAME pushl %ebp; movl %esp, %ebp
38 #define B_ARG0 8(%ebp)
39 #define B_ARG1 12(%ebp)
40 #define B_ARG2 16(%ebp)
41 #define B_ARG3 20(%ebp)
50 #define LB(x,n) ./**/x
51 #define LBb(x,n) ./**/x
52 #define LBf(x,n) ./**/x
54 #define SVC lcall $7,$0
56 #define String .string
58 #define Times(a,b) [a\*b]
59 #define Divide(a,b) [a\\b]
62 #define OUTB outb (%dx)
64 #define OUTL outl (%dx)
74 #define LEXT(x) .type EXT(x),@function; EXT(x):
75 #define LBb(x,n) n ## b
76 #define LBf(x,n) n ## f
79 #define LEXT(x) .type EXT(x),@function; EXT(x)/**/:
80 #define LBb(x,n) n/**/b
81 #define LBf(x,n) n/**/f
83 #define SVC .byte 0x9a; .long 0; .word 0x7
87 #define Times(a,b) (a*b)
88 #define Divide(a,b) (a/b)
90 #define INB inb %dx, %al
91 #define OUTB outb %al, %dx
92 #define INL inl %dx, %eax
93 #define OUTL outl %eax, %dx
97 #define addr32 .byte 0x67
98 #define data32 .byte 0x66
103 #define MCOUNT .data; LB(x, 9); .long 0; .text; lea LBb(x, 9),%edx; call mcount
104 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \
105 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
106 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
107 .align ALIGN; LEXT(x) LEXT(y) ; \
108 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
109 #define ASENTRY(x) .globl x; .align ALIGN; x ## : ; \
110 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
114 #define MCOUNT .data; LB(x, 9): .long 0; .text; lea LBb(x, 9),%edx; call mcount
115 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \
116 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
117 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
118 .align ALIGN; LEXT(x) LEXT(y)
119 #define ASENTRY(x) .globl x; .align ALIGN; x: ; \
120 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
122 #endif /* __STDC__ */
127 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x)
128 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
129 .align ALIGN; LEXT(x) LEXT(y)
130 #define ASENTRY(x) .globl x; .align ALIGN; x ## :
135 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x)
136 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
137 .align ALIGN; LEXT(x) LEXT(y)
138 #define ASENTRY(x) .globl x; .align ALIGN; x:
140 #endif /* __STDC__ */
143 #define Entry(x) .globl EXT(x); .align ALIGN; LEXT(x)
144 #define DATA(x) .globl EXT(x); .align ALIGN; LEXT(x)