1 /* 2 * Copyright 2002-2012 Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _ARCH_SIGNAL_H_ 6 #define _ARCH_SIGNAL_H_ 7 8 9 /* 10 * Architecture-specific structure passed to signal handlers 11 */ 12 13 #if __x86_64__ 14 15 16 struct fp_stack { 17 unsigned char st0[10]; 18 unsigned char _reserved_42_47[6]; 19 unsigned char st1[10]; 20 unsigned char _reserved_58_63[6]; 21 unsigned char st2[10]; 22 unsigned char _reserved_74_79[6]; 23 unsigned char st3[10]; 24 unsigned char _reserved_90_95[6]; 25 unsigned char st4[10]; 26 unsigned char _reserved_106_111[6]; 27 unsigned char st5[10]; 28 unsigned char _reserved_122_127[6]; 29 unsigned char st6[10]; 30 unsigned char _reserved_138_143[6]; 31 unsigned char st7[10]; 32 unsigned char _reserved_154_159[6]; 33 }; 34 35 struct mmx_regs { 36 unsigned char mm0[10]; 37 unsigned char _reserved_42_47[6]; 38 unsigned char mm1[10]; 39 unsigned char _reserved_58_63[6]; 40 unsigned char mm2[10]; 41 unsigned char _reserved_74_79[6]; 42 unsigned char mm3[10]; 43 unsigned char _reserved_90_95[6]; 44 unsigned char mm4[10]; 45 unsigned char _reserved_106_111[6]; 46 unsigned char mm5[10]; 47 unsigned char _reserved_122_127[6]; 48 unsigned char mm6[10]; 49 unsigned char _reserved_138_143[6]; 50 unsigned char mm7[10]; 51 unsigned char _reserved_154_159[6]; 52 }; 53 54 struct xmm_regs { 55 unsigned char xmm0[16]; 56 unsigned char xmm1[16]; 57 unsigned char xmm2[16]; 58 unsigned char xmm3[16]; 59 unsigned char xmm4[16]; 60 unsigned char xmm5[16]; 61 unsigned char xmm6[16]; 62 unsigned char xmm7[16]; 63 unsigned char xmm8[16]; 64 unsigned char xmm9[16]; 65 unsigned char xmm10[16]; 66 unsigned char xmm11[16]; 67 unsigned char xmm12[16]; 68 unsigned char xmm13[16]; 69 unsigned char xmm14[16]; 70 unsigned char xmm15[16]; 71 }; 72 73 struct fpu_state { 74 unsigned short control; 75 unsigned short status; 76 unsigned short tag; 77 unsigned short opcode; 78 unsigned long rip; 79 unsigned long rdp; 80 unsigned int mxcsr; 81 unsigned int mscsr_mask; 82 83 union { 84 struct fp_stack fp; 85 struct mmx_regs mmx; 86 }; 87 88 struct xmm_regs xmm; 89 unsigned char _reserved_416_511[96]; 90 }; 91 92 struct xstate_hdr { 93 unsigned long bv; 94 unsigned long xcomp_bv; 95 unsigned char _reserved[48]; 96 }; 97 98 struct savefpu { 99 struct fpu_state fp_fxsave; 100 struct xstate_hdr fp_xstate; 101 unsigned long fp_ymm[16][2]; 102 }; 103 104 struct vregs { 105 unsigned long rax; 106 unsigned long rbx; 107 unsigned long rcx; 108 unsigned long rdx; 109 unsigned long rdi; 110 unsigned long rsi; 111 unsigned long rbp; 112 unsigned long r8; 113 unsigned long r9; 114 unsigned long r10; 115 unsigned long r11; 116 unsigned long r12; 117 unsigned long r13; 118 unsigned long r14; 119 unsigned long r15; 120 121 unsigned long rsp; 122 unsigned long rip; 123 unsigned long rflags; 124 125 struct savefpu fpu; 126 }; 127 128 129 #endif /* __x86_64__ */ 130 131 #endif /* _ARCH_SIGNAL_H_ */ 132