Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / hppa / include / asm.h
blobfe74616e4a7621e5d9b1205adafc96fe05bd9066
1 /* $NetBSD: asm.h,v 1.9 2007/12/02 15:55:09 skrll Exp $ */
3 /* $OpenBSD: asm.h,v 1.12 2001/03/29 02:15:57 mickey Exp $ */
5 /*
6 * Copyright (c) 1990,1991,1994 The University of Utah and
7 * the Computer Systems Laboratory (CSL). All rights reserved.
9 * Permission to use, copy, modify and distribute this software is hereby
10 * granted provided that (1) source code retains these copyright, permission,
11 * and disclaimer notices, and (2) redistributions including binaries
12 * reproduce the notices in supporting documentation, and (3) all advertising
13 * materials mentioning features or use of this software display the following
14 * acknowledgement: ``This product includes software developed by the
15 * Computer Systems Laboratory at the University of Utah.''
17 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
18 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
19 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 * CSL requests users of this software to return to csl-dist@cs.utah.edu any
22 * improvements that they make and grant CSL redistribution rights.
24 * Utah $Hdr: asm.h 1.8 94/12/14$
27 #ifndef _HPPA_ASM_H_
28 #define _HPPA_ASM_H_
30 #include <machine/frame.h>
32 * hppa assembler definitions
35 #ifdef __STDC__
36 #define __CONCAT(a,b) a ## b
37 #else
38 #define __CONCAT(a,b) a/**/b
39 #endif
41 #define _C_LABEL(x) x
43 #define _ASM_LS_CHAR !
45 #define LEAF_ENTRY_NOPROFILE(x) !\
46 ! .text ! .align 4 !\
47 .export x, entry ! .label x ! .proc !\
48 .callinfo frame=0, no_calls, save_rp !\
49 .entry
51 #define ENTRY_NOPROFILE(x,n) !\
52 ! .text ! .align 4 !\
53 .export x, entry ! .label x ! .proc !\
54 .callinfo frame=n, calls, save_rp, save_sp !\
55 .entry
57 #ifdef GPROF
59 #define _PROF_PROLOGUE !\
60 1: !\
61 stw %rp, HPPA_FRAME_CRP(%sp) !\
62 stw %arg0, HPPA_FRAME_ARG(0)(%sp) !\
63 stw %arg1, HPPA_FRAME_ARG(1)(%sp) !\
64 stw %arg2, HPPA_FRAME_ARG(2)(%sp) !\
65 stw %arg3, HPPA_FRAME_ARG(3)(%sp) !\
66 ldo HPPA_FRAME_SIZE(%sp), %sp !\
67 copy %rp, %arg0 !\
68 bl 2f, %arg1 !\
69 depi 0, 31, 2, %arg1 !\
70 2: !\
71 bl _mcount, %rp !\
72 ldo 1b - 2b(%arg1), %arg1 !\
73 ldo -HPPA_FRAME_SIZE(%sp), %sp !\
74 ldw HPPA_FRAME_ARG(3)(%sp), %arg3 !\
75 ldw HPPA_FRAME_ARG(2)(%sp), %arg2 !\
76 ldw HPPA_FRAME_ARG(1)(%sp), %arg1 !\
77 ldw HPPA_FRAME_ARG(0)(%sp), %arg0 !\
78 ldw HPPA_FRAME_CRP(%sp), %rp !\
80 #define LEAF_ENTRY(x) !\
81 ENTRY_NOPROFILE(x,HPPA_FRAME_SIZE) !\
82 _PROF_PROLOGUE
84 #else /* GPROF */
86 #define _PROF_PROLOGUE
88 #define LEAF_ENTRY(x) !\
89 LEAF_ENTRY_NOPROFILE(x)
91 #endif /* GPROF */
93 #define ENTRY(x,n) !\
94 ENTRY_NOPROFILE(x,n) !\
95 _PROF_PROLOGUE
97 #define ALTENTRY(x) ! .export x, entry ! .label x
98 #define EXIT(x) ! .exit ! .procend ! .size x, .-x
100 #define RCSID(x) .text !\
101 .asciz x !\
102 .align 4
104 #define WEAK_ALIAS(alias,sym) \
105 .weak alias ! \
106 alias = sym
109 * STRONG_ALIAS: create a strong alias.
111 #define STRONG_ALIAS(alias,sym) \
112 .globl alias ! \
113 alias = sym
115 #define CALL(func,tmp) !\
116 ldil L%func, tmp !\
117 ldo R%func(tmp), tmp !\
118 .call !\
119 blr %r0, %rp !\
120 bv,n %r0(tmp) !\
123 #ifdef PIC
124 #define PIC_CALL(func) !\
125 addil LT%func, %r19 !\
126 ldw RT%func(%r1), %r1 !\
127 .call !\
128 blr %r0, %rp !\
129 bv,n %r0(%r1) !\
131 #else
132 #define PIC_CALL(func) !\
133 CALL(func,%r1)
134 #endif
136 #ifdef __STDC__
137 #define WARN_REFERENCES(sym,msg) \
138 .stabs msg ## ,30,0,0,0 ; \
139 .stabs __STRING(sym) ## ,1,0,0,0
140 #else
141 #define WARN_REFERENCES(sym,msg) \
142 .stabs msg,30,0,0,0 ; \
143 .stabs __STRING(sym),1,0,0,0
144 #endif
146 #define BSS(n,s) ! .data ! .label n ! .comm s
147 #define SZREG 4
149 #endif /* _HPPA_ASM_H_ */