asm.h revision 1.4 1 1.2 glass /*-
2 1.4 glass * Copyright (c) 1993 Adam Glass
3 1.2 glass * Copyright (c) 1990 The Regents of the University of California.
4 1.2 glass * All rights reserved.
5 1.2 glass *
6 1.2 glass * This version based on the old asm.h which is ifdef notdefed at the end,
7 1.2 glass * and jolitz's i386 asm.h mess.
8 1.2 glass *
9 1.2 glass * This code is derived from software contributed to Berkeley by
10 1.2 glass * William Jolitz.
11 1.2 glass *
12 1.2 glass * Redistribution and use in source and binary forms, with or without
13 1.2 glass * modification, are permitted provided that the following conditions
14 1.2 glass * are met:
15 1.2 glass * 1. Redistributions of source code must retain the above copyright
16 1.2 glass * notice, this list of conditions and the following disclaimer.
17 1.2 glass * 2. Redistributions in binary form must reproduce the above copyright
18 1.2 glass * notice, this list of conditions and the following disclaimer in the
19 1.2 glass * documentation and/or other materials provided with the distribution.
20 1.2 glass * 3. All advertising materials mentioning features or use of this software
21 1.2 glass * must display the following acknowledgement:
22 1.2 glass * This product includes software developed by the University of
23 1.2 glass * California, Berkeley and its contributors.
24 1.2 glass * 4. Neither the name of the University nor the names of its contributors
25 1.2 glass * may be used to endorse or promote products derived from this software
26 1.2 glass * without specific prior written permission.
27 1.2 glass *
28 1.2 glass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 1.2 glass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 1.2 glass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 1.2 glass * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 1.2 glass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 1.2 glass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 1.2 glass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 1.2 glass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 1.2 glass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 1.2 glass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 1.2 glass * SUCH DAMAGE.
39 1.2 glass *
40 1.2 glass * from: @(#)asm.h 5.5 (Berkeley) 5/7/91
41 1.2 glass * asm.h,v 1.1 1993/06/16 21:42:47 mycroft Exp
42 1.2 glass */
43 1.2 glass
44 1.2 glass #ifndef _MACHINE_ASM_H_
45 1.2 glass #define _MACHINE_ASM_H_
46 1.2 glass
47 1.2 glass /*
48 1.2 glass * XXX assumes that arguments are not passed in %eax
49 1.2 glass */
50 1.2 glass
51 1.2 glass
52 1.2 glass #ifdef STDC
53 1.2 glass # define _C_FUNC(x) _ ## x
54 1.2 glass #else
55 1.2 glass # define _C_FUNC(x) _/**/x
56 1.2 glass #endif
57 1.2 glass #define _ASM_FUNC(x) x
58 1.2 glass
59 1.3 glass #define ALIGN_TEXT .align 2
60 1.1 glass #ifdef GPROF
61 1.2 glass # define _BEGIN_ENTRY
62 1.2 glass # define _END_ENTRY link a6,#0; jbsr mcount; unlk a6 ;
63 1.2 glass # define _ENTER_FUNC(x) jra _C_FUNC(x)+12
64 1.2 glass #else
65 1.2 glass # define _BEGIN_ENTRY
66 1.2 glass # define _END_ENTRY
67 1.2 glass # define _ENTER_FUNC(x) ;
68 1.2 glass #endif
69 1.2 glass
70 1.3 glass #define _ENTRY(x) .globl x; ALIGN_TEXT; x:
71 1.2 glass
72 1.2 glass #define ENTRY(y) _BEGIN_ENTRY; _ENTRY(_C_FUNC(y)); _END_ENTRY
73 1.2 glass #define TWOENTRY(y,z) _BEGIN_ENTRY; _ENTRY(_C_FUNC(z)); _END_ENTRY \
74 1.2 glass _ENTER_FUNC(y); \
75 1.2 glass _ENTRY(_C_FUNC(y)); _END_ENTRY
76 1.2 glass #define ASENTRY(y) _BEGIN_ENTRY; _ENTRY(_ASM_FUNC(y)); _END_ENTRY
77 1.2 glass
78 1.2 glass #define ASMSTR .asciz
79 1.2 glass
80 1.2 glass #endif /* !_MACHINE_ASM_H_ */
81