| 1 | /* |
| 2 | * i386 dependent signal definitions |
| 3 | * |
| 4 | * Copyright (c) 2013 Stacey D. Son |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | #ifndef TARGET_ARCH_SIGNAL_H |
| 9 | #define TARGET_ARCH_SIGNAL_H |
| 10 | |
| 11 | #include "cpu.h" |
| 12 | |
| 13 | /* Size of the signal trampolin code placed on the stack. */ |
| 14 | #define TARGET_SZSIGCODE 0 |
| 15 | |
| 16 | /* compare to x86/include/_limits.h */ |
| 17 | #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */ |
| 18 | #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ |
| 19 | |
| 20 | typedef struct target_mcontext { |
| 21 | abi_ulong mc_onstack; /* XXX - sigcontext compat. */ |
| 22 | abi_ulong mc_gs; /* machine state (struct trapframe) */ |
| 23 | abi_ulong mc_fs; |
| 24 | abi_ulong mc_es; |
| 25 | abi_ulong mc_ds; |
| 26 | abi_ulong mc_edi; |
| 27 | abi_ulong mc_esi; |
| 28 | abi_ulong mc_ebp; |
| 29 | abi_ulong mc_isp; |
| 30 | abi_ulong mc_ebx; |
| 31 | abi_ulong mc_edx; |
| 32 | abi_ulong mc_ecx; |
| 33 | abi_ulong mc_eax; |
| 34 | abi_ulong mc_trapno; |
| 35 | abi_ulong mc_err; |
| 36 | abi_ulong mc_eip; |
| 37 | abi_ulong mc_cs; |
| 38 | abi_ulong mc_eflags; |
| 39 | abi_ulong mc_esp; |
| 40 | abi_ulong mc_ss; |
| 41 | |
| 42 | int32_t mc_len; /* sizeof(mcontext_t) */ |
| 43 | #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ |
| 44 | #define _MC_FPFMT_387 0x10001 |
| 45 | #define _MC_FPFMT_XMM 0x10002 |
| 46 | int32_t mc_fpformat; |
| 47 | #define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ |
| 48 | #define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ |
| 49 | #define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ |
| 50 | int32_t mc_ownedfp; |
| 51 | abi_ulong mc_flags; |
| 52 | /* |
| 53 | * See <machine/npx.h> for the internals of mc_fpstate[]. |
| 54 | */ |
| 55 | int32_t mc_fpstate[128] __aligned(16); |
| 56 | |
| 57 | abi_ulong mc_fsbase; |
| 58 | abi_ulong mc_gsbase; |
| 59 | |
| 60 | abi_ulong mc_xfpustate; |
| 61 | abi_ulong mc_xfpustate_len; |
| 62 | |
| 63 | int32_t mc_spare2[4]; |
| 64 | } target_mcontext_t; |
| 65 | |
| 66 | #define TARGET_MCONTEXT_SIZE 640 |
| 67 | #define TARGET_UCONTEXT_SIZE 704 |
| 68 | |
| 69 | #include "target_os_ucontext.h" |
| 70 | |
| 71 | struct target_sigframe { |
| 72 | abi_ulong sf_signum; |
| 73 | abi_ulong sf_siginfo; /* code or pointer to sf_si */ |
| 74 | abi_ulong sf_ucontext; /* points to sf_uc */ |
| 75 | abi_ulong sf_addr; /* undocumented 4th arg */ |
| 76 | target_ucontext_t sf_uc; /* = *sf_uncontext */ |
| 77 | target_siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case)*/ |
| 78 | uint32_t __spare__[2]; |
| 79 | }; |
| 80 | |
| 81 | #define TARGET_SIGSTACK_ALIGN 8 |
| 82 | |
| 83 | #endif /* TARGET_ARCH_SIGNAL_H */ |