1 1.16 christos /* $NetBSD: mcontext.h,v 1.16 2024/11/30 01:04:09 christos Exp $ */ 2 1.1 chs 3 1.1 chs #ifndef _HPPA_MCONTEXT_H_ 4 1.3 chs #define _HPPA_MCONTEXT_H_ 5 1.1 chs 6 1.3 chs /* 7 1.3 chs * General register state 8 1.3 chs */ 9 1.3 chs #define _NGREG 44 10 1.3 chs 11 1.12 skrll #define _REG_R1 1 12 1.12 skrll #define _REG_R2 2 13 1.12 skrll #define _REG_R3 3 14 1.12 skrll #define _REG_R4 4 15 1.12 skrll #define _REG_R5 5 16 1.12 skrll #define _REG_R6 6 17 1.12 skrll #define _REG_R7 7 18 1.12 skrll #define _REG_R8 8 19 1.12 skrll #define _REG_R9 9 20 1.12 skrll #define _REG_R10 10 21 1.12 skrll #define _REG_R11 11 22 1.12 skrll #define _REG_R12 12 23 1.12 skrll #define _REG_R13 13 24 1.12 skrll #define _REG_R14 14 25 1.12 skrll #define _REG_R15 15 26 1.12 skrll #define _REG_R16 16 27 1.12 skrll #define _REG_R17 17 28 1.12 skrll #define _REG_R18 18 29 1.12 skrll #define _REG_R19 19 30 1.12 skrll #define _REG_R20 20 31 1.12 skrll #define _REG_R21 21 32 1.12 skrll #define _REG_R22 22 33 1.12 skrll #define _REG_R23 23 34 1.12 skrll #define _REG_R24 24 35 1.12 skrll #define _REG_R25 25 36 1.12 skrll #define _REG_R26 26 37 1.12 skrll #define _REG_R27 27 38 1.12 skrll #define _REG_R28 28 39 1.12 skrll #define _REG_R29 29 40 1.12 skrll #define _REG_R30 30 41 1.12 skrll #define _REG_R31 31 42 1.12 skrll 43 1.3 chs #define _REG_PSW 0 44 1.3 chs #define _REG_RP 2 45 1.3 chs #define _REG_R19 19 46 1.3 chs #define _REG_ARG0 26 47 1.3 chs #define _REG_DP 27 48 1.3 chs #define _REG_RET0 28 49 1.3 chs #define _REG_SP 30 50 1.3 chs #define _REG_SAR 32 51 1.3 chs #define _REG_PCSQH 33 52 1.3 chs #define _REG_PCSQT 34 53 1.3 chs #define _REG_PCOQH 35 54 1.3 chs #define _REG_PCOQT 36 55 1.3 chs #define _REG_SR0 37 56 1.3 chs #define _REG_SR1 38 57 1.3 chs #define _REG_SR2 39 58 1.3 chs #define _REG_SR3 40 59 1.3 chs #define _REG_SR4 41 60 1.3 chs #define _REG_CR26 42 61 1.3 chs #define _REG_CR27 43 62 1.3 chs 63 1.3 chs #ifndef __ASSEMBLER__ 64 1.3 chs 65 1.3 chs typedef unsigned long __greg_t; 66 1.3 chs typedef __greg_t __gregset_t[_NGREG]; 67 1.3 chs 68 1.3 chs /* 69 1.3 chs * Floating point register state 70 1.3 chs */ 71 1.3 chs 72 1.3 chs typedef struct { 73 1.3 chs union { 74 1.3 chs unsigned long long __fp_regs[32]; 75 1.3 chs double __fp_dregs[32]; 76 1.3 chs } __fp_fr; 77 1.3 chs } __fpregset_t; 78 1.3 chs 79 1.3 chs typedef struct { 80 1.3 chs __gregset_t __gregs; 81 1.3 chs __fpregset_t __fpregs; 82 1.1 chs } mcontext_t; 83 1.1 chs 84 1.3 chs #define _UC_MACHINE_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_SP]) 85 1.9 kamil #define _UC_MACHINE_FP(uc) ((uc)->uc_mcontext.__gregs[3]) 86 1.3 chs #define _UC_MACHINE_PC(uc) ((uc)->uc_mcontext.__gregs[_REG_PCOQH]) 87 1.3 chs #define _UC_MACHINE_SET_PC(uc, pc) \ 88 1.3 chs do { \ 89 1.3 chs (uc)->uc_mcontext.__gregs[_REG_PCOQH] = (pc); \ 90 1.3 chs (uc)->uc_mcontext.__gregs[_REG_PCOQT] = (pc) + 4; \ 91 1.3 chs } while (/*CONSTCOND*/0) 92 1.10 kamil #define _UC_MACHINE_INTRV(uc) ((uc)->uc_mcontext.__gregs[_REG_RET0]) 93 1.3 chs 94 1.3 chs #endif /* !__ASSEMBLER__ */ 95 1.3 chs 96 1.13 thorpej #define _UC_SETSTACK _UC_MD_BIT16 97 1.13 thorpej #define _UC_CLRSTACK _UC_MD_BIT17 98 1.13 thorpej #define _UC_TLSBASE _UC_MD_BIT18 99 1.1 chs 100 1.1 chs #endif /* _HPPA_MCONTEXT_H_ */ 101