Home | History | Annotate | Line # | Download | only in include
asm.h revision 1.7
      1 /*	$NetBSD: asm.h,v 1.7 2007/04/07 08:34:17 skrll 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 (at) 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 ! .size x, .-x
     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 /*
     78  * STRONG_ALIAS: create a strong alias.
     79  */
     80 #define STRONG_ALIAS(alias,sym)				\
     81 	.globl alias !					\
     82 	alias = sym
     83 
     84 #define CALL(func,tmp)					!\
     85 	ldil	L%func, tmp				!\
     86 	ldo	R%func(tmp), tmp			!\
     87 	.call						!\
     88 	blr	%r0, %rp				!\
     89 	bv,n	%r0(tmp)				!\
     90 	nop
     91 
     92 #ifdef PIC
     93 #define PIC_CALL(func)					!\
     94 	addil	LT%func, %r19				!\
     95 	ldw	RT%func(%r1), %r1			!\
     96 	.call						!\
     97 	blr	%r0, %rp				!\
     98 	bv,n	%r0(%r1)				!\
     99 	nop
    100 #else
    101 #define PIC_CALL(func)					!\
    102 	CALL(func,%r1)
    103 #endif
    104 
    105 #ifdef __STDC__
    106 #define	WARN_REFERENCES(sym,msg)					\
    107 	.stabs msg ## ,30,0,0,0 ;					\
    108 	.stabs __STRING(sym) ## ,1,0,0,0
    109 #else
    110 #define	WARN_REFERENCES(sym,msg)					\
    111 	.stabs msg,30,0,0,0 ;						\
    112 	.stabs __STRING(sym),1,0,0,0
    113 #endif
    114 
    115 #define	BSS(n,s)	! .data ! .label n ! .comm s
    116 #define	SZREG	4
    117 
    118 #endif /* _HPPA_ASM_H_ */
    119