7 #include <asm/ptrace.h>
9 #define DEFINE(sym, val) \
10 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
12 #define DEFINE_LONGS(sym, val) \
13 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
15 #define OFFSET(sym, str, mem) \
16 DEFINE(sym, offsetof(struct str, mem));
20 OFFSET(HOST_SC_IP, sigcontext, eip);
21 OFFSET(HOST_SC_SP, sigcontext, esp);
22 OFFSET(HOST_SC_FS, sigcontext, fs);
23 OFFSET(HOST_SC_GS, sigcontext, gs);
24 OFFSET(HOST_SC_DS, sigcontext, ds);
25 OFFSET(HOST_SC_ES, sigcontext, es);
26 OFFSET(HOST_SC_SS, sigcontext, ss);
27 OFFSET(HOST_SC_CS, sigcontext, cs);
28 OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
29 OFFSET(HOST_SC_EAX, sigcontext, eax);
30 OFFSET(HOST_SC_EBX, sigcontext, ebx);
31 OFFSET(HOST_SC_ECX, sigcontext, ecx);
32 OFFSET(HOST_SC_EDX, sigcontext, edx);
33 OFFSET(HOST_SC_EDI, sigcontext, edi);
34 OFFSET(HOST_SC_ESI, sigcontext, esi);
35 OFFSET(HOST_SC_EBP, sigcontext, ebp);
36 OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
37 OFFSET(HOST_SC_ERR, sigcontext, err);
38 OFFSET(HOST_SC_CR2, sigcontext, cr2);
39 OFFSET(HOST_SC_FPSTATE, sigcontext, fpstate);
40 OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
41 OFFSET(HOST_SC_FP_CW, _fpstate, cw);
42 OFFSET(HOST_SC_FP_SW, _fpstate, sw);
43 OFFSET(HOST_SC_FP_TAG, _fpstate, tag);
44 OFFSET(HOST_SC_FP_IPOFF, _fpstate, ipoff);
45 OFFSET(HOST_SC_FP_CSSEL, _fpstate, cssel);
46 OFFSET(HOST_SC_FP_DATAOFF, _fpstate, dataoff);
47 OFFSET(HOST_SC_FP_DATASEL, _fpstate, datasel);
48 OFFSET(HOST_SC_FP_ST, _fpstate, _st);
49 OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
51 DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
52 DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct));
55 DEFINE(HOST_SP, UESP);
56 DEFINE(HOST_EFLAGS, EFL);
57 DEFINE(HOST_EAX, EAX);
58 DEFINE(HOST_EBX, EBX);
59 DEFINE(HOST_ECX, ECX);
60 DEFINE(HOST_EDX, EDX);
61 DEFINE(HOST_ESI, ESI);
62 DEFINE(HOST_EDI, EDI);
63 DEFINE(HOST_EBP, EBP);
70 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
72 /* XXX Duplicated between i386 and x86_64 */
73 DEFINE(UM_POLLIN, POLLIN);
74 DEFINE(UM_POLLPRI, POLLPRI);
75 DEFINE(UM_POLLOUT, POLLOUT);
77 DEFINE(UM_PROT_READ, PROT_READ);
78 DEFINE(UM_PROT_WRITE, PROT_WRITE);
79 DEFINE(UM_PROT_EXEC, PROT_EXEC);