3 #include <asm/ptrace.h>
5 #include <linux/stddef.h>
7 #define DEFINE(sym, val) \
8 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
10 #define DEFINE_LONGS(sym, val) \
11 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
13 #define OFFSET(sym, str, mem) \
14 DEFINE(sym, offsetof(struct str, mem));
18 OFFSET(HOST_SC_IP, sigcontext, eip);
19 OFFSET(HOST_SC_SP, sigcontext, esp);
20 OFFSET(HOST_SC_FS, sigcontext, fs);
21 OFFSET(HOST_SC_GS, sigcontext, gs);
22 OFFSET(HOST_SC_DS, sigcontext, ds);
23 OFFSET(HOST_SC_ES, sigcontext, es);
24 OFFSET(HOST_SC_SS, sigcontext, ss);
25 OFFSET(HOST_SC_CS, sigcontext, cs);
26 OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
27 OFFSET(HOST_SC_EAX, sigcontext, eax);
28 OFFSET(HOST_SC_EBX, sigcontext, ebx);
29 OFFSET(HOST_SC_ECX, sigcontext, ecx);
30 OFFSET(HOST_SC_EDX, sigcontext, edx);
31 OFFSET(HOST_SC_EDI, sigcontext, edi);
32 OFFSET(HOST_SC_ESI, sigcontext, esi);
33 OFFSET(HOST_SC_EBP, sigcontext, ebp);
34 OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
35 OFFSET(HOST_SC_ERR, sigcontext, err);
36 OFFSET(HOST_SC_CR2, sigcontext, cr2);
37 OFFSET(HOST_SC_FPSTATE, sigcontext, fpstate);
38 OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
39 OFFSET(HOST_SC_FP_CW, _fpstate, cw);
40 OFFSET(HOST_SC_FP_SW, _fpstate, sw);
41 OFFSET(HOST_SC_FP_TAG, _fpstate, tag);
42 OFFSET(HOST_SC_FP_IPOFF, _fpstate, ipoff);
43 OFFSET(HOST_SC_FP_CSSEL, _fpstate, cssel);
44 OFFSET(HOST_SC_FP_DATAOFF, _fpstate, dataoff);
45 OFFSET(HOST_SC_FP_DATASEL, _fpstate, datasel);
46 OFFSET(HOST_SC_FP_ST, _fpstate, _st);
47 OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
49 DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE);
50 DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct));
51 DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct));
54 DEFINE(HOST_SP, UESP);
55 DEFINE(HOST_EFLAGS, EFL);
56 DEFINE(HOST_EAX, EAX);
57 DEFINE(HOST_EBX, EBX);
58 DEFINE(HOST_ECX, ECX);
59 DEFINE(HOST_EDX, EDX);
60 DEFINE(HOST_ESI, ESI);
61 DEFINE(HOST_EDI, EDI);
62 DEFINE(HOST_EBP, EBP);
69 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));