4 #define __FRAME_OFFSETS
5 #include <asm/ptrace.h>
8 #define DEFINE(sym, val) \
9 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
11 #define OFFSET(sym, str, mem) \
12 DEFINE(sym, offsetof(struct str, mem));
16 OFFSET(SC_RBX
, sigcontext
, rbx
);
17 OFFSET(SC_RCX
, sigcontext
, rcx
);
18 OFFSET(SC_RDX
, sigcontext
, rdx
);
19 OFFSET(SC_RSI
, sigcontext
, rsi
);
20 OFFSET(SC_RDI
, sigcontext
, rdi
);
21 OFFSET(SC_RBP
, sigcontext
, rbp
);
22 OFFSET(SC_RAX
, sigcontext
, rax
);
23 OFFSET(SC_R8
, sigcontext
, r8
);
24 OFFSET(SC_R9
, sigcontext
, r9
);
25 OFFSET(SC_R10
, sigcontext
, r10
);
26 OFFSET(SC_R11
, sigcontext
, r11
);
27 OFFSET(SC_R12
, sigcontext
, r12
);
28 OFFSET(SC_R13
, sigcontext
, r13
);
29 OFFSET(SC_R14
, sigcontext
, r14
);
30 OFFSET(SC_R15
, sigcontext
, r15
);
31 OFFSET(SC_IP
, sigcontext
, rip
);
32 OFFSET(SC_SP
, sigcontext
, rsp
);
33 OFFSET(SC_CR2
, sigcontext
, cr2
);
34 OFFSET(SC_ERR
, sigcontext
, err
);
35 OFFSET(SC_TRAPNO
, sigcontext
, trapno
);
36 OFFSET(SC_CS
, sigcontext
, cs
);
37 OFFSET(SC_FS
, sigcontext
, fs
);
38 OFFSET(SC_GS
, sigcontext
, gs
);
39 OFFSET(SC_EFLAGS
, sigcontext
, eflags
);
40 OFFSET(SC_SIGMASK
, sigcontext
, oldmask
);
42 OFFSET(SC_ORIG_RAX
, sigcontext
, orig_rax
);
43 OFFSET(SC_DS
, sigcontext
, ds
);
44 OFFSET(SC_ES
, sigcontext
, es
);
45 OFFSET(SC_SS
, sigcontext
, ss
);
48 DEFINE(HOST_FRAME_SIZE
, FRAME_SIZE
);
49 DEFINE(HOST_RBX
, RBX
);
50 DEFINE(HOST_RCX
, RCX
);
51 DEFINE(HOST_RDI
, RDI
);
52 DEFINE(HOST_RSI
, RSI
);
53 DEFINE(HOST_RDX
, RDX
);
54 DEFINE(HOST_RBP
, RBP
);
55 DEFINE(HOST_RAX
, RAX
);
58 DEFINE(HOST_R10
, R10
);
59 DEFINE(HOST_R11
, R11
);
60 DEFINE(HOST_R12
, R12
);
61 DEFINE(HOST_R13
, R13
);
62 DEFINE(HOST_R14
, R14
);
63 DEFINE(HOST_R15
, R15
);
64 DEFINE(HOST_ORIG_RAX
, ORIG_RAX
);
67 DEFINE(HOST_EFLAGS
, EFLAGS
);
77 DEFINE(__UM_FRAME_SIZE
, sizeof(struct user_regs_struct
));