master
h 91 lines 2.53 KB
Raw
1 /*
2 * x86_64 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_rdi; /* machine state (struct trapframe) */
23 abi_ulong mc_rsi;
24 abi_ulong mc_rdx;
25 abi_ulong mc_rcx;
26 abi_ulong mc_r8;
27 abi_ulong mc_r9;
28 abi_ulong mc_rax;
29 abi_ulong mc_rbx;
30 abi_ulong mc_rbp;
31 abi_ulong mc_r10;
32 abi_ulong mc_r11;
33 abi_ulong mc_r12;
34 abi_ulong mc_r13;
35 abi_ulong mc_r14;
36 abi_ulong mc_r15;
37 uint32_t mc_trapno;
38 uint16_t mc_fs;
39 uint16_t mc_gs;
40 abi_ulong mc_addr;
41 uint32_t mc_flags;
42 uint16_t mc_es;
43 uint16_t mc_ds;
44 abi_ulong mc_err;
45 abi_ulong mc_rip;
46 abi_ulong mc_cs;
47 abi_ulong mc_rflags;
48 abi_ulong mc_rsp;
49 abi_ulong mc_ss;
50
51 abi_long mc_len; /* sizeof(mcontext_t) */
52
53 #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */
54 #define _MC_FPFMT_XMM 0x10002
55 abi_long mc_fpformat;
56 #define _MC_FPOWNED_NONE 0x20000 /* FP state not used */
57 #define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */
58 #define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */
59 abi_long mc_ownedfp;
60 /*
61 * See <machine/fpu.h> for the internals of mc_fpstate[].
62 */
63 abi_long mc_fpstate[64] __aligned(16);
64
65 abi_ulong mc_fsbase;
66 abi_ulong mc_gsbase;
67
68 abi_ulong mc_xfpustate;
69 abi_ulong mc_xfpustate_len;
70
71 abi_long mc_spare[4];
72 } target_mcontext_t;
73
74 #define TARGET_MCONTEXT_SIZE 800
75 #define TARGET_UCONTEXT_SIZE 880
76
77 #include "target_os_ucontext.h"
78
79 struct target_sigframe {
80 abi_ulong sf_signum;
81 abi_ulong sf_siginfo; /* code or pointer to sf_si */
82 abi_ulong sf_ucontext; /* points to sf_uc */
83 abi_ulong sf_addr; /* undocumented 4th arg */
84 target_ucontext_t sf_uc; /* = *sf_uncontext */
85 target_siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case)*/
86 uint32_t __spare__[2];
87 };
88
89 #define TARGET_SIGSTACK_ALIGN 16
90
91 #endif /* TARGET_ARCH_SIGNAL_H */