1 1.4 christos /* $NetBSD: mcontext.h,v 1.4 2003/10/26 08:06:56 christos Exp $ */ 2 1.3 christos 3 1.3 christos #ifndef _SPARC64_MCONTEXT_H_ 4 1.3 christos #define _SPARC64_MCONTEXT_H_ 5 1.2 thorpej 6 1.2 thorpej #include <sparc/mcontext.h> 7 1.3 christos 8 1.3 christos #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.3 christos #define _REG32_PSR 0 13 1.3 christos #define _REG32_PC 1 14 1.3 christos #define _REG32_nPC 2 15 1.3 christos #define _REG32_Y 3 16 1.3 christos #define _REG32_G1 4 17 1.3 christos #define _REG32_G2 5 18 1.3 christos #define _REG32_G3 6 19 1.3 christos #define _REG32_G4 7 20 1.3 christos #define _REG32_G5 8 21 1.3 christos #define _REG32_G6 9 22 1.3 christos #define _REG32_G7 10 23 1.3 christos #define _REG32_O0 11 24 1.3 christos #define _REG32_O1 12 25 1.3 christos #define _REG32_O2 13 26 1.3 christos #define _REG32_O3 14 27 1.3 christos #define _REG32_O4 15 28 1.3 christos #define _REG32_O5 16 29 1.3 christos #define _REG32_O6 17 30 1.3 christos #define _REG32_O7 18 31 1.3 christos 32 1.3 christos /* Layout of a register window. */ 33 1.3 christos typedef struct { 34 1.3 christos __greg32_t __rw_local[8]; /* %l0-7 */ 35 1.3 christos __greg32_t __rw_in[8]; /* %i0-7 */ 36 1.3 christos } __rwindow32_t; 37 1.3 christos 38 1.3 christos /* Description of available register windows. */ 39 1.3 christos typedef struct { 40 1.3 christos int __wbcnt; 41 1.3 christos __greg32_t * __spbuf[_SPARC_MAXREGWINDOW]; 42 1.3 christos __rwindow32_t __wbuf[_SPARC_MAXREGWINDOW]; 43 1.3 christos } __gwindows32_t; 44 1.3 christos 45 1.3 christos /* FPU state description */ 46 1.3 christos typedef struct { 47 1.3 christos union { 48 1.3 christos unsigned int __fpu_regs[32]; 49 1.3 christos double __fpu_dregs[16]; 50 1.3 christos } __fpu_fr; /* FPR contents */ 51 1.3 christos struct __fq * __fpu_q; /* pointer to FPU insn queue */ 52 1.3 christos unsigned int __fpu_fsr; /* %fsr */ 53 1.3 christos unsigned char __fpu_qcnt; /* # entries in __fpu_q */ 54 1.3 christos unsigned char __fpu_q_entrysize; /* size of a __fpu_q entry */ 55 1.3 christos unsigned char __fpu_en; /* this context valid? */ 56 1.3 christos } __fpregset32_t; 57 1.3 christos 58 1.3 christos typedef struct { 59 1.3 christos __gregset32_t __gregs; /* GPR state */ 60 1.3 christos __gwindows32_t *__gwins; /* may point to register windows */ 61 1.3 christos __fpregset32_t __fpregs; /* FPU state, if any */ 62 1.3 christos __xrs_t __xrs; /* may indicate extra reg state */ 63 1.3 christos } mcontext32_t; 64 1.4 christos 65 1.4 christos #define _UC_SETSTACK 0x00010000 66 1.4 christos #define _UC_CLRSTACK 0x00020000 67 1.3 christos 68 1.3 christos #define _UC_MACHINE32_PAD_32 /* Padding appended to ucontext_t */ 69 1.3 christos #define _UC_MACHINE32_SP(uc) ((uc)->uc_mcontext.__gregs[_REG32_O6]) 70 1.3 christos 71 1.3 christos #endif /* _SPARC64_MCONTEXT_H_ */ 72