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