Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / um / sys-x86_64 / user-offsets.c
blob263989e02bd8042fc169b09d0dd6054ad4a422db
1 #include <stdio.h>
2 #include <stddef.h>
3 #include <signal.h>
4 #include <sys/poll.h>
5 #include <sys/mman.h>
6 #include <sys/user.h>
7 #define __FRAME_OFFSETS
8 #include <asm/ptrace.h>
9 #include <asm/types.h>
11 #define DEFINE(sym, val) \
12 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
14 #define DEFINE_LONGS(sym, val) \
15 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
17 #define OFFSET(sym, str, mem) \
18 DEFINE(sym, offsetof(struct str, mem));
20 void foo(void)
22 <<<<<<< HEAD:arch/um/sys-x86_64/user-offsets.c
23 OFFSET(HOST_SC_RBX, sigcontext, rbx);
24 OFFSET(HOST_SC_RCX, sigcontext, rcx);
25 OFFSET(HOST_SC_RDX, sigcontext, rdx);
26 OFFSET(HOST_SC_RSI, sigcontext, rsi);
27 OFFSET(HOST_SC_RDI, sigcontext, rdi);
28 OFFSET(HOST_SC_RBP, sigcontext, rbp);
29 OFFSET(HOST_SC_RAX, sigcontext, rax);
30 OFFSET(HOST_SC_R8, sigcontext, r8);
31 OFFSET(HOST_SC_R9, sigcontext, r9);
32 OFFSET(HOST_SC_R10, sigcontext, r10);
33 OFFSET(HOST_SC_R11, sigcontext, r11);
34 OFFSET(HOST_SC_R12, sigcontext, r12);
35 OFFSET(HOST_SC_R13, sigcontext, r13);
36 OFFSET(HOST_SC_R14, sigcontext, r14);
37 OFFSET(HOST_SC_R15, sigcontext, r15);
38 OFFSET(HOST_SC_IP, sigcontext, rip);
39 OFFSET(HOST_SC_SP, sigcontext, rsp);
40 =======
41 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/um/sys-x86_64/user-offsets.c
42 OFFSET(HOST_SC_CR2, sigcontext, cr2);
43 OFFSET(HOST_SC_ERR, sigcontext, err);
44 OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
45 <<<<<<< HEAD:arch/um/sys-x86_64/user-offsets.c
46 OFFSET(HOST_SC_CS, sigcontext, cs);
47 OFFSET(HOST_SC_FS, sigcontext, fs);
48 OFFSET(HOST_SC_GS, sigcontext, gs);
49 OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
50 OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
51 #if 0
52 OFFSET(HOST_SC_ORIG_RAX, sigcontext, orig_rax);
53 OFFSET(HOST_SC_DS, sigcontext, ds);
54 OFFSET(HOST_SC_ES, sigcontext, es);
55 OFFSET(HOST_SC_SS, sigcontext, ss);
56 #endif
57 =======
58 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/um/sys-x86_64/user-offsets.c
60 DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
61 DEFINE(HOST_XFP_SIZE, 0);
62 DEFINE_LONGS(HOST_RBX, RBX);
63 DEFINE_LONGS(HOST_RCX, RCX);
64 DEFINE_LONGS(HOST_RDI, RDI);
65 DEFINE_LONGS(HOST_RSI, RSI);
66 DEFINE_LONGS(HOST_RDX, RDX);
67 DEFINE_LONGS(HOST_RBP, RBP);
68 DEFINE_LONGS(HOST_RAX, RAX);
69 DEFINE_LONGS(HOST_R8, R8);
70 DEFINE_LONGS(HOST_R9, R9);
71 DEFINE_LONGS(HOST_R10, R10);
72 DEFINE_LONGS(HOST_R11, R11);
73 DEFINE_LONGS(HOST_R12, R12);
74 DEFINE_LONGS(HOST_R13, R13);
75 DEFINE_LONGS(HOST_R14, R14);
76 DEFINE_LONGS(HOST_R15, R15);
77 DEFINE_LONGS(HOST_ORIG_RAX, ORIG_RAX);
78 DEFINE_LONGS(HOST_CS, CS);
79 DEFINE_LONGS(HOST_SS, SS);
80 DEFINE_LONGS(HOST_EFLAGS, EFLAGS);
81 #if 0
82 DEFINE_LONGS(HOST_FS, FS);
83 DEFINE_LONGS(HOST_GS, GS);
84 DEFINE_LONGS(HOST_DS, DS);
85 DEFINE_LONGS(HOST_ES, ES);
86 #endif
88 DEFINE_LONGS(HOST_IP, RIP);
89 DEFINE_LONGS(HOST_SP, RSP);
90 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
92 /* XXX Duplicated between i386 and x86_64 */
93 DEFINE(UM_POLLIN, POLLIN);
94 DEFINE(UM_POLLPRI, POLLPRI);
95 DEFINE(UM_POLLOUT, POLLOUT);
97 DEFINE(UM_PROT_READ, PROT_READ);
98 DEFINE(UM_PROT_WRITE, PROT_WRITE);
99 DEFINE(UM_PROT_EXEC, PROT_EXEC);