xref: /dragonfly/lib/libc/x86_64/sys/asmcontext.c (revision 655933d6)
1 #define _KERNEL_STRUCTURES
2 #include <sys/types.h>
3 #include <sys/signal.h>
4 #include <sys/ucontext.h>
5 #include <sys/assym.h>
6 #include <machine/frame.h>
7 #include <machine/tss.h>
8 #include <machine/segments.h>
9 #include <stddef.h>
10 
11 ASSYM(UC_SIGMASK, offsetof(ucontext_t, uc_sigmask));
12 ASSYM(UC_LINK, offsetof(ucontext_t, uc_link));
13 ASSYM(UC_MCONTEXT, offsetof(ucontext_t, uc_mcontext));
14 ASSYM(SIG_BLOCK, SIG_BLOCK);
15 #ifdef __x86_64__
16 ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL));
17 ASSYM(KUDSEL, GSEL(GUDATA_SEL, SEL_UPL));
18 ASSYM(MC_ONSTACK, offsetof(mcontext_t, mc_onstack));
19 ASSYM(MC_RDI, offsetof(mcontext_t, mc_rdi));
20 ASSYM(MC_RSI, offsetof(mcontext_t, mc_rsi));
21 ASSYM(MC_RDX, offsetof(mcontext_t, mc_rdx));
22 ASSYM(MC_RCX, offsetof(mcontext_t, mc_rcx));
23 ASSYM(MC_R8, offsetof(mcontext_t, mc_r8));
24 ASSYM(MC_R9, offsetof(mcontext_t, mc_r9));
25 ASSYM(MC_RAX, offsetof(mcontext_t, mc_rax));
26 ASSYM(MC_RBX, offsetof(mcontext_t, mc_rbx));
27 ASSYM(MC_RBP, offsetof(mcontext_t, mc_rbp));
28 ASSYM(MC_R10, offsetof(mcontext_t, mc_r10));
29 ASSYM(MC_R11, offsetof(mcontext_t, mc_r11));
30 ASSYM(MC_R12, offsetof(mcontext_t, mc_r12));
31 ASSYM(MC_R13, offsetof(mcontext_t, mc_r13));
32 ASSYM(MC_R14, offsetof(mcontext_t, mc_r14));
33 ASSYM(MC_R15, offsetof(mcontext_t, mc_r15));
34 ASSYM(MC_RIP, offsetof(mcontext_t, mc_rip));
35 ASSYM(MC_CS, offsetof(mcontext_t, mc_cs));
36 ASSYM(MC_RFLAGS, offsetof(mcontext_t, mc_rflags));
37 ASSYM(MC_RSP, offsetof(mcontext_t, mc_rsp));
38 ASSYM(MC_SS, offsetof(mcontext_t, mc_ss));
39 ASSYM(_MC_FPOWNED_NONE, _MC_FPOWNED_NONE);
40 ASSYM(_MC_FPFMT_NODEV, _MC_FPFMT_NODEV);
41 #endif
42 ASSYM(MC_LEN, offsetof(mcontext_t, mc_len));
43 ASSYM(MC_FPFORMAT, offsetof(mcontext_t, mc_fpformat));
44 ASSYM(MC_OWNEDFP, offsetof(mcontext_t, mc_ownedfp));
45 ASSYM(SIZEOF_MCONTEXT_T, sizeof(mcontext_t));
46