4 #define __FRAME_OFFSETS
5 #include <asm/ptrace.h>
7 /* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
8 * refuse to include here, even though they're used throughout the headers.
9 * These are used in asm/user.h, and that include can't be avoided because of
10 * the sizeof(struct user_regs_struct) below.
16 #define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
19 #define OFFSET(sym, str, mem) \
20 DEFINE(sym, offsetof(struct str, mem));
24 OFFSET(SC_RBX
, sigcontext
, rbx
);
25 OFFSET(SC_RCX
, sigcontext
, rcx
);
26 OFFSET(SC_RDX
, sigcontext
, rdx
);
27 OFFSET(SC_RSI
, sigcontext
, rsi
);
28 OFFSET(SC_RDI
, sigcontext
, rdi
);
29 OFFSET(SC_RBP
, sigcontext
, rbp
);
30 OFFSET(SC_RAX
, sigcontext
, rax
);
31 OFFSET(SC_R8
, sigcontext
, r8
);
32 OFFSET(SC_R9
, sigcontext
, r9
);
33 OFFSET(SC_R10
, sigcontext
, r10
);
34 OFFSET(SC_R11
, sigcontext
, r11
);
35 OFFSET(SC_R12
, sigcontext
, r12
);
36 OFFSET(SC_R13
, sigcontext
, r13
);
37 OFFSET(SC_R14
, sigcontext
, r14
);
38 OFFSET(SC_R15
, sigcontext
, r15
);
39 OFFSET(SC_IP
, sigcontext
, rip
);
40 OFFSET(SC_SP
, sigcontext
, rsp
);
41 OFFSET(SC_CR2
, sigcontext
, cr2
);
42 OFFSET(SC_ERR
, sigcontext
, err
);
43 OFFSET(SC_TRAPNO
, sigcontext
, trapno
);
44 OFFSET(SC_CS
, sigcontext
, cs
);
45 OFFSET(SC_FS
, sigcontext
, fs
);
46 OFFSET(SC_GS
, sigcontext
, gs
);
47 OFFSET(SC_EFLAGS
, sigcontext
, eflags
);
48 OFFSET(SC_SIGMASK
, sigcontext
, oldmask
);
50 OFFSET(SC_ORIG_RAX
, sigcontext
, orig_rax
);
51 OFFSET(SC_DS
, sigcontext
, ds
);
52 OFFSET(SC_ES
, sigcontext
, es
);
53 OFFSET(SC_SS
, sigcontext
, ss
);
56 DEFINE(HOST_FRAME_SIZE
, FRAME_SIZE
);
57 DEFINE(HOST_RBX
, RBX
);
58 DEFINE(HOST_RCX
, RCX
);
59 DEFINE(HOST_RDI
, RDI
);
60 DEFINE(HOST_RSI
, RSI
);
61 DEFINE(HOST_RDX
, RDX
);
62 DEFINE(HOST_RBP
, RBP
);
63 DEFINE(HOST_RAX
, RAX
);
66 DEFINE(HOST_R10
, R10
);
67 DEFINE(HOST_R11
, R11
);
68 DEFINE(HOST_R12
, R12
);
69 DEFINE(HOST_R13
, R13
);
70 DEFINE(HOST_R14
, R14
);
71 DEFINE(HOST_R15
, R15
);
72 DEFINE(HOST_ORIG_RAX
, ORIG_RAX
);
75 DEFINE(HOST_EFLAGS
, EFLAGS
);
85 DEFINE(__UM_FRAME_SIZE
, sizeof(struct user_regs_struct
));