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
27 * $FreeBSD: src/sys/i386/boot/biosboot/asm.h,v 1.9 1999/08/28 00:43:11 peter Exp $
28 * $DragonFly: src/sys/i386/boot/biosboot/Attic/asm.h,v 1.2 2003/06/17 04:28:34 dillon Exp $
31 #define S_ARG0 4(%esp)
32 #define S_ARG1 8(%esp)
33 #define S_ARG2 12(%esp)
34 #define S_ARG3 16(%esp)
36 #define FRAME pushl %ebp; movl %esp, %ebp
39 #define B_ARG0 8(%ebp)
40 #define B_ARG1 12(%ebp)
41 #define B_ARG2 16(%ebp)
42 #define B_ARG3 20(%ebp)
51 #define LB(x,n) ./**/x
52 #define LBb(x,n) ./**/x
53 #define LBf(x,n) ./**/x
55 #define SVC lcall $7,$0
57 #define String .string
59 #define Times(a,b) [a\*b]
60 #define Divide(a,b) [a\\b]
63 #define OUTB outb (%dx)
65 #define OUTL outl (%dx)
74 #define LEXT(x) _ ## x ## :
76 #define LBb(x,n) n ## b
77 #define LBf(x,n) n ## f
80 #define LEXT(x) _/**/x/**/:
81 #define LBb(x,n) n/**/b
82 #define LBf(x,n) n/**/f
84 #define SVC .byte 0x9a; .long 0; .word 0x7
88 #define Times(a,b) (a*b)
89 #define Divide(a,b) (a/b)
91 #define INB inb %dx, %al
92 #define OUTB outb %al, %dx
93 #define INL inl %dx, %eax
94 #define OUTL outl %eax, %dx
98 #define addr32 .byte 0x67
99 #define data32 .byte 0x66
104 #define MCOUNT .data; LB(x, 9); .long 0; .text; lea LBb(x, 9),%edx; call mcount
105 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \
106 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
107 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
108 .align ALIGN; LEXT(x) LEXT(y) ; \
109 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
110 #define ASENTRY(x) .globl x; .align ALIGN; x ## : ; \
111 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
115 #define MCOUNT .data; LB(x, 9): .long 0; .text; lea LBb(x, 9),%edx; call mcount
116 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \
117 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
118 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
119 .align ALIGN; LEXT(x) LEXT(y)
120 #define ASENTRY(x) .globl x; .align ALIGN; x: ; \
121 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
128 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x)
129 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
130 .align ALIGN; LEXT(x) LEXT(y)
131 #define ASENTRY(x) .globl x; .align ALIGN; x ## :
136 #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x)
137 #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \
138 .align ALIGN; LEXT(x) LEXT(y)
139 #define ASENTRY(x) .globl x; .align ALIGN; x:
144 #define Entry(x) .globl EXT(x); .align ALIGN; LEXT(x)
145 #define DATA(x) .globl EXT(x); .align ALIGN; LEXT(x)