xref: /netbsd-src/sys/arch/hppa/include/asm.h (revision 23c8222edbfb0f0932d88a8351d3a0cf817dfb9e)
1 /*	$NetBSD: asm.h,v 1.4 2004/07/18 23:21:35 chs Exp $	*/
2 
3 /*	$OpenBSD: asm.h,v 1.12 2001/03/29 02:15:57 mickey Exp $	*/
4 
5 /*
6  * Copyright (c) 1990,1991,1994 The University of Utah and
7  * the Computer Systems Laboratory (CSL).  All rights reserved.
8  *
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.''
16  *
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.
20  *
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.
23  *
24  *	Utah $Hdr: asm.h 1.8 94/12/14$
25  */
26 
27 #ifndef _HPPA_ASM_H_
28 #define _HPPA_ASM_H_
29 
30 /*
31  *	hppa assembler definitions
32  */
33 
34 #ifdef __STDC__
35 #define	__CONCAT(a,b)	a ## b
36 #else
37 #define	__CONCAT(a,b)	a/**/b
38 #endif
39 
40 #ifdef PROF
41 #define	_PROF_PROLOGUE !\
42 	stw %rp, HPPA_FRAME_CRP(%sr0,%sp)	!\
43 	ldil L%_mcount,%r1		!\
44 	ble R%_mcount(%sr0,%r1)		!\
45 	ldo HPPA_FRAME_SIZE(%sp),%sp	!\
46 	ldw HPPA_FRAME_CRP(%sr0,%sp),%rp
47 #else
48 #define	_PROF_PROLOGUE
49 #endif
50 
51 #define	LEAF_ENTRY(x) ! .text ! .align	4	!\
52 	.export	x, entry ! .label x ! .proc	!\
53 	.callinfo frame=0,no_calls,save_rp	!\
54 	.entry ! _PROF_PROLOGUE
55 
56 #define	ENTRY(x,n) ! .text ! .align 4			!\
57 	.export	x, entry ! .label x ! .proc		!\
58 	.callinfo frame=n,calls, save_rp, save_sp	!\
59 	.entry ! _PROF_PROLOGUE
60 
61 #define	ENTRY_NOPROFILE(x,n) ! .text ! .align 4		!\
62 	.export x, entry ! .label x ! .proc		!\
63 	.callinfo frame=n,calls, save_rp, save_sp	!\
64 	.entry
65 
66 #define ALTENTRY(x) ! .export x, entry ! .label  x
67 #define EXIT(x) ! .exit ! .procend
68 
69 #define RCSID(x)	.text				!\
70 			.asciz x			!\
71 			.align	4
72 
73 #define WEAK_ALIAS(alias,sym)				\
74 	.weak alias !					\
75 	alias = sym
76 
77 #define CALL(func,tmp)					!\
78 	ldil	L%func, tmp				!\
79 	ldo	R%func(tmp), tmp			!\
80 	.call						!\
81 	blr	%r0, %rp				!\
82 	bv,n	%r0(tmp)				!\
83 	nop
84 
85 #ifdef PIC
86 #define PIC_CALL(func)					!\
87 	addil	LT%func, %r19				!\
88 	ldw	RT%func(%r1), %r1			!\
89 	.call						!\
90 	blr	%r0, %rp				!\
91 	bv,n	%r0(%r1)				!\
92 	nop
93 #else
94 #define PIC_CALL(func)					!\
95 	CALL(func,%r1)
96 #endif
97 
98 /* XXX unimplemented */
99 #define WARN_REFERENCES(sym, msg)
100 
101 #define	SZREG	4
102 
103 #endif /* _HPPA_ASM_H_ */
104