Home | History | Annotate | Line # | Download | only in include
asm.h revision 1.19.146.1
      1  1.19.146.1  yamt /*       $NetBSD: asm.h,v 1.19.146.1 2014/05/22 11:40:09 yamt Exp $        */
      2         1.1   eeh 
      3        1.19   mrg #include <sparc/asm.h>
      4  1.19.146.1  yamt 
      5  1.19.146.1  yamt /*
      6  1.19.146.1  yamt  * Here are some defines to try to maintain consistency but still
      7  1.19.146.1  yamt  * support 32-and 64-bit compilers.
      8  1.19.146.1  yamt  */
      9  1.19.146.1  yamt #ifdef _LP64
     10  1.19.146.1  yamt /* reg that points to base of data/text segment */
     11  1.19.146.1  yamt #define	BASEREG	%g4
     12  1.19.146.1  yamt /* first constants for storage allocation */
     13  1.19.146.1  yamt #define LNGSZ		8
     14  1.19.146.1  yamt #define LNGSHFT		3
     15  1.19.146.1  yamt #define PTRSZ		8
     16  1.19.146.1  yamt #define PTRSHFT		3
     17  1.19.146.1  yamt #define POINTER		.xword
     18  1.19.146.1  yamt #define ULONG		.xword
     19  1.19.146.1  yamt /* Now instructions to load/store pointers & long ints */
     20  1.19.146.1  yamt #define LDLNG		ldx
     21  1.19.146.1  yamt #define LDULNG		ldx
     22  1.19.146.1  yamt #define STLNG		stx
     23  1.19.146.1  yamt #define STULNG		stx
     24  1.19.146.1  yamt #define LDPTR		ldx
     25  1.19.146.1  yamt #define LDPTRA		ldxa
     26  1.19.146.1  yamt #define STPTR		stx
     27  1.19.146.1  yamt #define STPTRA		stxa
     28  1.19.146.1  yamt #define	CASPTR		casx
     29  1.19.146.1  yamt #define	CASPTRA		casxa
     30  1.19.146.1  yamt /* Now something to calculate the stack bias */
     31  1.19.146.1  yamt #define STKB		BIAS
     32  1.19.146.1  yamt #define	CCCR		%xcc
     33  1.19.146.1  yamt #else
     34  1.19.146.1  yamt #define	BASEREG		%g0
     35  1.19.146.1  yamt #define LNGSZ		4
     36  1.19.146.1  yamt #define LNGSHFT		2
     37  1.19.146.1  yamt #define PTRSZ		4
     38  1.19.146.1  yamt #define PTRSHFT		2
     39  1.19.146.1  yamt #define POINTER		.word
     40  1.19.146.1  yamt #define ULONG		.word
     41  1.19.146.1  yamt /* Instructions to load/store pointers & long ints */
     42  1.19.146.1  yamt #define LDLNG		ldsw
     43  1.19.146.1  yamt #define LDULNG		lduw
     44  1.19.146.1  yamt #define STLNG		stw
     45  1.19.146.1  yamt #define STULNG		stw
     46  1.19.146.1  yamt #define LDPTR		lduw
     47  1.19.146.1  yamt #define LDPTRA		lduwa
     48  1.19.146.1  yamt #define STPTR		stw
     49  1.19.146.1  yamt #define STPTRA		stwa
     50  1.19.146.1  yamt #define	CASPTR		cas
     51  1.19.146.1  yamt #define	CASPTRA		casa
     52  1.19.146.1  yamt #define STKB		0
     53  1.19.146.1  yamt #define	CCCR		%icc
     54  1.19.146.1  yamt #endif
     55  1.19.146.1  yamt 
     56  1.19.146.1  yamt #if defined(_KERNEL) || defined(_RUMPKERNEL)
     57  1.19.146.1  yamt /* Give this real authority: reset the machine */
     58  1.19.146.1  yamt #define NOTREACHED	sir
     59  1.19.146.1  yamt #else
     60  1.19.146.1  yamt #define NOTREACHED
     61  1.19.146.1  yamt #endif
     62  1.19.146.1  yamt 
     63  1.19.146.1  yamt /* if < 32, copy by bytes, memcpy, kcopy, ... */
     64  1.19.146.1  yamt #define	BCOPY_SMALL	32
     65  1.19.146.1  yamt 
     66  1.19.146.1  yamt /* use as needed to align things on longword boundaries */
     67  1.19.146.1  yamt #define	_ALIGN	.align 8
     68  1.19.146.1  yamt #define ICACHE_ALIGN	.align	32
     69