aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/user-offsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-x86_64/user-offsets.c')
-rw-r--r--arch/um/sys-x86_64/user-offsets.c117
1 files changed, 61 insertions, 56 deletions
diff --git a/arch/um/sys-x86_64/user-offsets.c b/arch/um/sys-x86_64/user-offsets.c
index 513d17ceafd4..5a585bfbb8c2 100644
--- a/arch/um/sys-x86_64/user-offsets.c
+++ b/arch/um/sys-x86_64/user-offsets.c
@@ -16,71 +16,76 @@ typedef __u32 u32;
16#define DEFINE(sym, val) \ 16#define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
18 18
19#define DEFINE_LONGS(sym, val) \
20 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
21
19#define OFFSET(sym, str, mem) \ 22#define OFFSET(sym, str, mem) \
20 DEFINE(sym, offsetof(struct str, mem)); 23 DEFINE(sym, offsetof(struct str, mem));
21 24
22void foo(void) 25void foo(void)
23{ 26{
24 OFFSET(SC_RBX, sigcontext, rbx); 27 OFFSET(HOST_SC_RBX, sigcontext, rbx);
25 OFFSET(SC_RCX, sigcontext, rcx); 28 OFFSET(HOST_SC_RCX, sigcontext, rcx);
26 OFFSET(SC_RDX, sigcontext, rdx); 29 OFFSET(HOST_SC_RDX, sigcontext, rdx);
27 OFFSET(SC_RSI, sigcontext, rsi); 30 OFFSET(HOST_SC_RSI, sigcontext, rsi);
28 OFFSET(SC_RDI, sigcontext, rdi); 31 OFFSET(HOST_SC_RDI, sigcontext, rdi);
29 OFFSET(SC_RBP, sigcontext, rbp); 32 OFFSET(HOST_SC_RBP, sigcontext, rbp);
30 OFFSET(SC_RAX, sigcontext, rax); 33 OFFSET(HOST_SC_RAX, sigcontext, rax);
31 OFFSET(SC_R8, sigcontext, r8); 34 OFFSET(HOST_SC_R8, sigcontext, r8);
32 OFFSET(SC_R9, sigcontext, r9); 35 OFFSET(HOST_SC_R9, sigcontext, r9);
33 OFFSET(SC_R10, sigcontext, r10); 36 OFFSET(HOST_SC_R10, sigcontext, r10);
34 OFFSET(SC_R11, sigcontext, r11); 37 OFFSET(HOST_SC_R11, sigcontext, r11);
35 OFFSET(SC_R12, sigcontext, r12); 38 OFFSET(HOST_SC_R12, sigcontext, r12);
36 OFFSET(SC_R13, sigcontext, r13); 39 OFFSET(HOST_SC_R13, sigcontext, r13);
37 OFFSET(SC_R14, sigcontext, r14); 40 OFFSET(HOST_SC_R14, sigcontext, r14);
38 OFFSET(SC_R15, sigcontext, r15); 41 OFFSET(HOST_SC_R15, sigcontext, r15);
39 OFFSET(SC_IP, sigcontext, rip); 42 OFFSET(HOST_SC_IP, sigcontext, rip);
40 OFFSET(SC_SP, sigcontext, rsp); 43 OFFSET(HOST_SC_SP, sigcontext, rsp);
41 OFFSET(SC_CR2, sigcontext, cr2); 44 OFFSET(HOST_SC_CR2, sigcontext, cr2);
42 OFFSET(SC_ERR, sigcontext, err); 45 OFFSET(HOST_SC_ERR, sigcontext, err);
43 OFFSET(SC_TRAPNO, sigcontext, trapno); 46 OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
44 OFFSET(SC_CS, sigcontext, cs); 47 OFFSET(HOST_SC_CS, sigcontext, cs);
45 OFFSET(SC_FS, sigcontext, fs); 48 OFFSET(HOST_SC_FS, sigcontext, fs);
46 OFFSET(SC_GS, sigcontext, gs); 49 OFFSET(HOST_SC_GS, sigcontext, gs);
47 OFFSET(SC_EFLAGS, sigcontext, eflags); 50 OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
48 OFFSET(SC_SIGMASK, sigcontext, oldmask); 51 OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
49#if 0 52#if 0
50 OFFSET(SC_ORIG_RAX, sigcontext, orig_rax); 53 OFFSET(HOST_SC_ORIG_RAX, sigcontext, orig_rax);
51 OFFSET(SC_DS, sigcontext, ds); 54 OFFSET(HOST_SC_DS, sigcontext, ds);
52 OFFSET(SC_ES, sigcontext, es); 55 OFFSET(HOST_SC_ES, sigcontext, es);
53 OFFSET(SC_SS, sigcontext, ss); 56 OFFSET(HOST_SC_SS, sigcontext, ss);
54#endif 57#endif
55 58
56 DEFINE(HOST_FRAME_SIZE, FRAME_SIZE); 59 DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE);
57 DEFINE(HOST_RBX, RBX); 60 DEFINE(HOST_FP_SIZE, 0);
58 DEFINE(HOST_RCX, RCX); 61 DEFINE(HOST_XFP_SIZE, 0);
59 DEFINE(HOST_RDI, RDI); 62 DEFINE_LONGS(HOST_RBX, RBX);
60 DEFINE(HOST_RSI, RSI); 63 DEFINE_LONGS(HOST_RCX, RCX);
61 DEFINE(HOST_RDX, RDX); 64 DEFINE_LONGS(HOST_RDI, RDI);
62 DEFINE(HOST_RBP, RBP); 65 DEFINE_LONGS(HOST_RSI, RSI);
63 DEFINE(HOST_RAX, RAX); 66 DEFINE_LONGS(HOST_RDX, RDX);
64 DEFINE(HOST_R8, R8); 67 DEFINE_LONGS(HOST_RBP, RBP);
65 DEFINE(HOST_R9, R9); 68 DEFINE_LONGS(HOST_RAX, RAX);
66 DEFINE(HOST_R10, R10); 69 DEFINE_LONGS(HOST_R8, R8);
67 DEFINE(HOST_R11, R11); 70 DEFINE_LONGS(HOST_R9, R9);
68 DEFINE(HOST_R12, R12); 71 DEFINE_LONGS(HOST_R10, R10);
69 DEFINE(HOST_R13, R13); 72 DEFINE_LONGS(HOST_R11, R11);
70 DEFINE(HOST_R14, R14); 73 DEFINE_LONGS(HOST_R12, R12);
71 DEFINE(HOST_R15, R15); 74 DEFINE_LONGS(HOST_R13, R13);
72 DEFINE(HOST_ORIG_RAX, ORIG_RAX); 75 DEFINE_LONGS(HOST_R14, R14);
73 DEFINE(HOST_CS, CS); 76 DEFINE_LONGS(HOST_R15, R15);
74 DEFINE(HOST_SS, SS); 77 DEFINE_LONGS(HOST_ORIG_RAX, ORIG_RAX);
75 DEFINE(HOST_EFLAGS, EFLAGS); 78 DEFINE_LONGS(HOST_CS, CS);
79 DEFINE_LONGS(HOST_SS, SS);
80 DEFINE_LONGS(HOST_EFLAGS, EFLAGS);
76#if 0 81#if 0
77 DEFINE(HOST_FS, FS); 82 DEFINE_LONGS(HOST_FS, FS);
78 DEFINE(HOST_GS, GS); 83 DEFINE_LONGS(HOST_GS, GS);
79 DEFINE(HOST_DS, DS); 84 DEFINE_LONGS(HOST_DS, DS);
80 DEFINE(HOST_ES, ES); 85 DEFINE_LONGS(HOST_ES, ES);
81#endif 86#endif
82 87
83 DEFINE(HOST_IP, RIP); 88 DEFINE_LONGS(HOST_IP, RIP);
84 DEFINE(HOST_SP, RSP); 89 DEFINE_LONGS(HOST_SP, RSP);
85 DEFINE(__UM_FRAME_SIZE, sizeof(struct user_regs_struct)); 90 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
86} 91}