xref: /qemu/bsd-user/i386/target_arch_signal.h (revision 029e13a8a56a2931e7c24c0db52ae7256b932cb0)
1790baaccSWarner Losh /*
2790baaccSWarner Losh  *  i386 dependent signal definitions
3790baaccSWarner Losh  *
4790baaccSWarner Losh  *
5790baaccSWarner Losh  *  This program is free software; you can redistribute it and/or modify
6790baaccSWarner Losh  *  it under the terms of the GNU General Public License as published by
7790baaccSWarner Losh  *  the Free Software Foundation; either version 2 of the License, or
8790baaccSWarner Losh  *  (at your option) any later version.
9790baaccSWarner Losh  *
10790baaccSWarner Losh  *  This program is distributed in the hope that it will be useful,
11790baaccSWarner Losh  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12790baaccSWarner Losh  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13790baaccSWarner Losh  *  GNU General Public License for more details.
14790baaccSWarner Losh  *
15790baaccSWarner Losh  *  You should have received a copy of the GNU General Public License
16790baaccSWarner Losh  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
17790baaccSWarner Losh  */
18790baaccSWarner Losh #ifndef TARGET_ARCH_SIGNAL_H
19790baaccSWarner Losh #define TARGET_ARCH_SIGNAL_H
20790baaccSWarner Losh 
21790baaccSWarner Losh #include "cpu.h"
22790baaccSWarner Losh 
23790baaccSWarner Losh /* Size of the signal trampolin code placed on the stack. */
24790baaccSWarner Losh #define TARGET_SZSIGCODE    0
25790baaccSWarner Losh 
26790baaccSWarner Losh /* compare to  x86/include/_limits.h */
27790baaccSWarner Losh #define TARGET_MINSIGSTKSZ  (512 * 4)               /* min sig stack size */
28790baaccSWarner Losh #define TARGET_SIGSTKSZ     (MINSIGSTKSZ + 32768)   /* recommended size */
29790baaccSWarner Losh 
30790baaccSWarner Losh typedef struct target_mcontext {
31679041b1SWarner Losh     abi_ulong   mc_onstack;     /* XXX - sigcontext compat. */
32679041b1SWarner Losh     abi_ulong   mc_gs;          /* machine state (struct trapframe) */
33679041b1SWarner Losh     abi_ulong   mc_fs;
34679041b1SWarner Losh     abi_ulong   mc_es;
35679041b1SWarner Losh     abi_ulong   mc_ds;
36679041b1SWarner Losh     abi_ulong   mc_edi;
37679041b1SWarner Losh     abi_ulong   mc_esi;
38679041b1SWarner Losh     abi_ulong   mc_ebp;
39679041b1SWarner Losh     abi_ulong   mc_isp;
40679041b1SWarner Losh     abi_ulong   mc_ebx;
41679041b1SWarner Losh     abi_ulong   mc_edx;
42679041b1SWarner Losh     abi_ulong   mc_ecx;
43679041b1SWarner Losh     abi_ulong   mc_eax;
44679041b1SWarner Losh     abi_ulong   mc_trapno;
45679041b1SWarner Losh     abi_ulong   mc_err;
46679041b1SWarner Losh     abi_ulong   mc_eip;
47679041b1SWarner Losh     abi_ulong   mc_cs;
48679041b1SWarner Losh     abi_ulong   mc_eflags;
49679041b1SWarner Losh     abi_ulong   mc_esp;
50679041b1SWarner Losh     abi_ulong   mc_ss;
51679041b1SWarner Losh 
52679041b1SWarner Losh     int32_t     mc_len;                 /* sizeof(mcontext_t) */
53679041b1SWarner Losh #define _MC_FPFMT_NODEV         0x10000 /* device not present or configured */
54679041b1SWarner Losh #define _MC_FPFMT_387           0x10001
55679041b1SWarner Losh #define _MC_FPFMT_XMM           0x10002
56679041b1SWarner Losh     int32_t     mc_fpformat;
57679041b1SWarner Losh #define _MC_FPOWNED_NONE        0x20000 /* FP state not used */
58679041b1SWarner Losh #define _MC_FPOWNED_FPU         0x20001 /* FP state came from FPU */
59679041b1SWarner Losh #define _MC_FPOWNED_PCB         0x20002 /* FP state came from PCB */
60679041b1SWarner Losh     int32_t     mc_ownedfp;
61679041b1SWarner Losh     abi_ulong mc_flags;
62679041b1SWarner Losh         /*
63679041b1SWarner Losh          * See <machine/npx.h> for the internals of mc_fpstate[].
64679041b1SWarner Losh          */
65679041b1SWarner Losh     int32_t     mc_fpstate[128] __aligned(16);
66679041b1SWarner Losh 
67679041b1SWarner Losh     abi_ulong mc_fsbase;
68679041b1SWarner Losh     abi_ulong mc_gsbase;
69679041b1SWarner Losh 
70679041b1SWarner Losh     abi_ulong mc_xfpustate;
71679041b1SWarner Losh     abi_ulong mc_xfpustate_len;
72679041b1SWarner Losh 
73679041b1SWarner Losh     int32_t     mc_spare2[4];
74790baaccSWarner Losh } target_mcontext_t;
75790baaccSWarner Losh 
76679041b1SWarner Losh #define TARGET_MCONTEXT_SIZE 640
77679041b1SWarner Losh #define TARGET_UCONTEXT_SIZE 704
78679041b1SWarner Losh 
79c504713fSWarner Losh #include "target_os_ucontext.h"
80790baaccSWarner Losh 
81790baaccSWarner Losh struct target_sigframe {
82790baaccSWarner Losh     abi_ulong   sf_signum;
83790baaccSWarner Losh     abi_ulong   sf_siginfo;    /* code or pointer to sf_si */
84790baaccSWarner Losh     abi_ulong   sf_ucontext;   /* points to sf_uc */
85790baaccSWarner Losh     abi_ulong   sf_addr;       /* undocumented 4th arg */
86790baaccSWarner Losh     target_ucontext_t   sf_uc; /* = *sf_uncontext */
87790baaccSWarner Losh     target_siginfo_t    sf_si; /* = *sf_siginfo (SA_SIGINFO case)*/
88790baaccSWarner Losh     uint32_t    __spare__[2];
89790baaccSWarner Losh };
90790baaccSWarner Losh 
91*5fa2a10bSWarner Losh #define TARGET_SIGSTACK_ALIGN 8
92*5fa2a10bSWarner Losh 
93790baaccSWarner Losh #endif /* TARGET_ARCH_SIGNAL_H */
94