]> git.saurik.com Git - apple/boot.git/blame - i386/libsaio/legacy/asm.h
boot-83.2.tar.gz
[apple/boot.git] / i386 / libsaio / legacy / asm.h
CommitLineData
14c7c974
A
1/*
2 * Mach Operating System
3 * Copyright (c) 1989 Carnegie-Mellon University
4 * All rights reserved. The CMU software License Agreement specifies
5 * the terms and conditions for use and redistribution.
6 */
7/*
8 * HISTORY
9 * $Log: asm.h,v $
10 * Revision 1.2 2000/03/07 06:10:59 wsanchez
11 * Make main branch like boot-3, which builds.
12 *
13 * Revision 1.1.2.1 2000/02/29 00:04:34 jliu
14 * Added legacy header files.
15 *
16 * Revision 1.1.1.1 1997/09/30 02:45:05 wsanchez
17 * Import of kernel from umeshv/kernel
18 *
19 * Revision 2.1.1.6 90/03/29 20:45:08 rvb
20 * Typo on ENTRY if gprof
21 * [90/03/29 rvb]
22 *
23 * Revision 2.1.1.5 90/02/28 15:47:31 rvb
24 * fix SVC for "ifdef wheeze" [kupfer]
25 *
26 * Revision 2.1.1.4 90/02/27 08:47:30 rvb
27 * Fix the GPROF definitions.
28 * ENTRY(x) gets profiled iffdef GPROF.
29 * Entry(x) (and DATA(x)) is NEVER profiled.
30 * MCOUNT can be used by asm that intends to build a frame,
31 * after the frame is built.
32 * [90/02/26 rvb]
33 *
34 * Revision 2.1.1.3 90/02/09 17:23:23 rvb
35 * Add #define addr16 .byte 0x67
36 * [90/02/09 rvb]
37 *
38 * Revision 2.1.1.2 89/11/10 09:51:33 rvb
39 * Added LBi, SVC and ENTRY
40 *
41 * Revision 2.1.1.1 89/10/22 11:29:38 rvb
42 * New a.out and coff compatible .s files.
43 * [89/10/16 rvb]
44 *
45 */
46
47
48#define S_ARG0 4(%esp)
49#define S_ARG1 8(%esp)
50#define S_ARG2 12(%esp)
51#define S_ARG3 16(%esp)
52
53#define FRAME pushl %ebp; movl %esp, %ebp
54#define EMARF leave
55
56#define B_ARG0 8(%ebp)
57#define B_ARG1 12(%ebp)
58#define B_ARG2 16(%ebp)
59#define B_ARG3 20(%ebp)
60
61#define EXT(x) _##x
62#define LBb(x,n) n##b
63#define LBf(x,n) n##f
64
65#define ALIGN 2
66#define LCL(x) x
67
68#define LB(x,n) n
69
70#define SVC .byte 0x9a; .long 0; .word 0x7
71#define String .ascii
72#define Value .word
73
74#define Times(a,b) (a*b)
75#define Divide(a,b) (a/b)
76
77#define INB inb %dx, %al
78#define OUTB outb %al, %dx
79#define INL inl %dx, %eax
80#define OUTL outl %eax, %dx
81
82#define data16 .byte 0x66
83#define addr16 .byte 0x67
84
85
86
87#ifdef GPROF
88#define MCOUNT .data; LB(x, 9): .long 0; .text; lea LBb(x, 9),%edx; call mcount
89#define ENTRY(x) .globl EXT(x); .align ALIGN; EXT(x): ; \
90 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
91#define ASENTRY(x) .globl x; .align ALIGN; x: ; \
92 pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
93#else /* GPROF */
94#define MCOUNT
95#define ENTRY(x) .globl EXT(x); .align ALIGN; EXT(x):
96#define ASENTRY(x) .globl x; .align ALIGN; x:
97#endif /* GPROF */
98
99#define Entry(x) .globl EXT(x); .align ALIGN; EXT(x):
100#define DATA(x) .globl EXT(x); .align ALIGN; EXT(x):
101