1 1.20 christos /* $NetBSD: asm.h,v 1.20 2013/03/16 23:04:22 christos 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.20 christos #define CASPTR casxa 29 1.20 christos /* Now something to calculate the stack bias */ 30 1.20 christos #define STKB BIAS 31 1.20 christos #define CCCR %xcc 32 1.20 christos #else 33 1.20 christos #define BASEREG %g0 34 1.20 christos #define LNGSZ 4 35 1.20 christos #define LNGSHFT 2 36 1.20 christos #define PTRSZ 4 37 1.20 christos #define PTRSHFT 2 38 1.20 christos #define POINTER .word 39 1.20 christos #define ULONG .word 40 1.20 christos /* Instructions to load/store pointers & long ints */ 41 1.20 christos #define LDLNG ldsw 42 1.20 christos #define LDULNG lduw 43 1.20 christos #define STLNG stw 44 1.20 christos #define STULNG stw 45 1.20 christos #define LDPTR lduw 46 1.20 christos #define LDPTRA lduwa 47 1.20 christos #define STPTR stw 48 1.20 christos #define STPTRA stwa 49 1.20 christos #define CASPTR casa 50 1.20 christos #define STKB 0 51 1.20 christos #define CCCR %icc 52 1.20 christos #endif 53 1.20 christos 54 1.20 christos #if defined(_KERNEL) || defined(_RUMPKERNEL) 55 1.20 christos /* Give this real authority: reset the machine */ 56 1.20 christos #define NOTREACHED sir 57 1.20 christos #else 58 1.20 christos #define NOTREACHED 59 1.20 christos #endif 60 1.20 christos 61 1.20 christos /* if < 32, copy by bytes, memcpy, kcopy, ... */ 62 1.20 christos #define BCOPY_SMALL 32 63 1.20 christos 64 1.20 christos /* use as needed to align things on longword boundaries */ 65 1.20 christos #define _ALIGN .align 8 66 1.20 christos #define ICACHE_ALIGN .align 32 67