1 1.11 thorpej /* $NetBSD: mcontext.h,v 1.11 2024/05/18 00:37:41 thorpej Exp $ */ 2 1.3 christos 3 1.3 christos #ifndef _SPARC64_MCONTEXT_H_ 4 1.10 mrg #define _SPARC64_MCONTEXT_H_ 5 1.2 thorpej 6 1.2 thorpej #include <sparc/mcontext.h> 7 1.3 christos 8 1.10 mrg #define _NGREG32 19 /* %psr, pc, npc, %g1-7, %o0-7 */ 9 1.3 christos typedef int __greg32_t; 10 1.3 christos typedef __greg32_t __gregset32_t[_NGREG32]; 11 1.3 christos 12 1.8 cube typedef unsigned int netbsd32___greg32p_t; 13 1.8 cube typedef unsigned int netbsd32___fqp_t; 14 1.8 cube typedef unsigned int netbsd32___gwindows32p_t; 15 1.7 cube 16 1.3 christos #define _REG32_PSR 0 17 1.3 christos #define _REG32_PC 1 18 1.3 christos #define _REG32_nPC 2 19 1.3 christos #define _REG32_Y 3 20 1.3 christos #define _REG32_G1 4 21 1.3 christos #define _REG32_G2 5 22 1.3 christos #define _REG32_G3 6 23 1.3 christos #define _REG32_G4 7 24 1.3 christos #define _REG32_G5 8 25 1.3 christos #define _REG32_G6 9 26 1.3 christos #define _REG32_G7 10 27 1.3 christos #define _REG32_O0 11 28 1.3 christos #define _REG32_O1 12 29 1.3 christos #define _REG32_O2 13 30 1.3 christos #define _REG32_O3 14 31 1.3 christos #define _REG32_O4 15 32 1.3 christos #define _REG32_O5 16 33 1.3 christos #define _REG32_O6 17 34 1.3 christos #define _REG32_O7 18 35 1.3 christos 36 1.3 christos /* Layout of a register window. */ 37 1.3 christos typedef struct { 38 1.3 christos __greg32_t __rw_local[8]; /* %l0-7 */ 39 1.3 christos __greg32_t __rw_in[8]; /* %i0-7 */ 40 1.3 christos } __rwindow32_t; 41 1.3 christos 42 1.3 christos /* Description of available register windows. */ 43 1.3 christos typedef struct { 44 1.3 christos int __wbcnt; 45 1.7 cube netbsd32___greg32p_t __spbuf[_SPARC_MAXREGWINDOW]; 46 1.3 christos __rwindow32_t __wbuf[_SPARC_MAXREGWINDOW]; 47 1.3 christos } __gwindows32_t; 48 1.3 christos 49 1.3 christos /* FPU state description */ 50 1.3 christos typedef struct { 51 1.3 christos union { 52 1.3 christos unsigned int __fpu_regs[32]; 53 1.3 christos double __fpu_dregs[16]; 54 1.3 christos } __fpu_fr; /* FPR contents */ 55 1.7 cube netbsd32___fqp_t __fpu_q; /* pointer to FPU insn queue */ 56 1.3 christos unsigned int __fpu_fsr; /* %fsr */ 57 1.3 christos unsigned char __fpu_qcnt; /* # entries in __fpu_q */ 58 1.3 christos unsigned char __fpu_q_entrysize; /* size of a __fpu_q entry */ 59 1.3 christos unsigned char __fpu_en; /* this context valid? */ 60 1.3 christos } __fpregset32_t; 61 1.3 christos 62 1.7 cube /* `Extra Register State'(?) */ 63 1.7 cube typedef struct { 64 1.7 cube unsigned int __xrs_id; /* See below */ 65 1.8 cube unsigned int __xrs_ptr; /* points into filler area */ 66 1.7 cube } __xrs32_t; 67 1.7 cube 68 1.3 christos typedef struct { 69 1.3 christos __gregset32_t __gregs; /* GPR state */ 70 1.7 cube netbsd32___gwindows32p_t __gwins;/* may point to register windows */ 71 1.3 christos __fpregset32_t __fpregs; /* FPU state, if any */ 72 1.7 cube __xrs32_t __xrs; /* may indicate extra reg state */ 73 1.3 christos } mcontext32_t; 74 1.4 christos 75 1.11 thorpej #define _UC_SETSTACK _UC_MD_BIT16 76 1.11 thorpej #define _UC_CLRSTACK _UC_MD_BIT17 77 1.11 thorpej #define _UC_TLSBASE _UC_MD_BIT19 78 1.3 christos 79 1.10 mrg #define _UC_MACHINE32_PAD 43 /* compat_netbsd32 variant */ 80 1.10 mrg #define _UC_MACHINE32_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_O6]) 81 1.10 mrg #define _UC_MACHINE32_FP(uc) (((__greg32_t *)_UC_MACHINE32_SP(uc))[15]) 82 1.10 mrg 83 1.3 christos #endif /* _SPARC64_MCONTEXT_H_ */ 84