1 /* 2 * Copyright 2002-2007, 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 * Architecture-specific structure passed to signal handlers 10 */ 11 12 #if __INTEL__ 13 14 typedef struct packed_fp_stack { 15 unsigned char st0[10]; 16 unsigned char st1[10]; 17 unsigned char st2[10]; 18 unsigned char st3[10]; 19 unsigned char st4[10]; 20 unsigned char st5[10]; 21 unsigned char st6[10]; 22 unsigned char st7[10]; 23 } packed_fp_stack; 24 25 typedef struct packed_mmx_regs { 26 unsigned char mm0[10]; 27 unsigned char mm1[10]; 28 unsigned char mm2[10]; 29 unsigned char mm3[10]; 30 unsigned char mm4[10]; 31 unsigned char mm5[10]; 32 unsigned char mm6[10]; 33 unsigned char mm7[10]; 34 } packed_mmx_regs; 35 36 typedef struct old_extended_regs { 37 unsigned short fp_control; 38 unsigned short _reserved1; 39 unsigned short fp_status; 40 unsigned short _reserved2; 41 unsigned short fp_tag; 42 unsigned short _reserved3; 43 unsigned long fp_eip; 44 unsigned short fp_cs; 45 unsigned short fp_opcode; 46 unsigned long fp_datap; 47 unsigned short fp_ds; 48 unsigned short _reserved4; 49 union { 50 packed_fp_stack fp; 51 packed_mmx_regs mmx; 52 } fp_mmx; 53 } old_extended_regs; 54 55 typedef struct fp_stack { 56 unsigned char st0[10]; 57 unsigned char _reserved_42_47[6]; 58 unsigned char st1[10]; 59 unsigned char _reserved_58_63[6]; 60 unsigned char st2[10]; 61 unsigned char _reserved_74_79[6]; 62 unsigned char st3[10]; 63 unsigned char _reserved_90_95[6]; 64 unsigned char st4[10]; 65 unsigned char _reserved_106_111[6]; 66 unsigned char st5[10]; 67 unsigned char _reserved_122_127[6]; 68 unsigned char st6[10]; 69 unsigned char _reserved_138_143[6]; 70 unsigned char st7[10]; 71 unsigned char _reserved_154_159[6]; 72 } fp_stack; 73 74 typedef struct mmx_regs { 75 unsigned char mm0[10]; 76 unsigned char _reserved_42_47[6]; 77 unsigned char mm1[10]; 78 unsigned char _reserved_58_63[6]; 79 unsigned char mm2[10]; 80 unsigned char _reserved_74_79[6]; 81 unsigned char mm3[10]; 82 unsigned char _reserved_90_95[6]; 83 unsigned char mm4[10]; 84 unsigned char _reserved_106_111[6]; 85 unsigned char mm5[10]; 86 unsigned char _reserved_122_127[6]; 87 unsigned char mm6[10]; 88 unsigned char _reserved_138_143[6]; 89 unsigned char mm7[10]; 90 unsigned char _reserved_154_159[6]; 91 } mmx_regs; 92 93 typedef struct xmmx_regs { 94 unsigned char xmm0[16]; 95 unsigned char xmm1[16]; 96 unsigned char xmm2[16]; 97 unsigned char xmm3[16]; 98 unsigned char xmm4[16]; 99 unsigned char xmm5[16]; 100 unsigned char xmm6[16]; 101 unsigned char xmm7[16]; 102 } xmmx_regs; 103 104 typedef struct new_extended_regs { 105 unsigned short fp_control; 106 unsigned short fp_status; 107 unsigned short fp_tag; 108 unsigned short fp_opcode; 109 unsigned long fp_eip; 110 unsigned short fp_cs; 111 unsigned short res_14_15; 112 unsigned long fp_datap; 113 unsigned short fp_ds; 114 unsigned short _reserved_22_23; 115 unsigned long mxcsr; 116 unsigned long _reserved_28_31; 117 union { 118 fp_stack fp; 119 mmx_regs mmx; 120 } fp_mmx; 121 xmmx_regs xmmx; 122 unsigned char _reserved_288_511[224]; 123 } new_extended_regs; 124 125 typedef struct extended_regs { 126 union { 127 old_extended_regs old_format; 128 new_extended_regs new_format; 129 } state; 130 unsigned long format; 131 } extended_regs; 132 133 struct vregs { 134 unsigned long eip; 135 unsigned long eflags; 136 unsigned long eax; 137 unsigned long ecx; 138 unsigned long edx; 139 unsigned long esp; 140 unsigned long ebp; 141 unsigned long _reserved_1; 142 extended_regs xregs; 143 unsigned long _reserved_2[3]; 144 }; 145 146 #endif /* __INTEL__ */ 147 148 #endif /* _ARCH_SIGNAL_H_ */ 149