user-offsets.c (e4da3fbfbd1de56d2367653e3823e6445e49f8a9) user-offsets.c (45db1c6176c8171d9ae6fa6d82e07d115a5950ca)
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>
10
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>
10
11#ifdef __i386__
12#define __SYSCALL_I386(nr, sym, compat) [nr] = 1,
13static char syscalls[] = {
14#include <asm/syscalls_32.h>
15};
16#else
17#define __SYSCALL_64(nr, sym, compat) [nr] = 1,
18static char syscalls[] = {
19#include <asm/syscalls_64.h>
20};
21#endif
22
11#define DEFINE(sym, val) \
12 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
13
14#define DEFINE_LONGS(sym, val) \
15 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
16
17void foo(void)
18{

--- 53 unchanged lines hidden (view full) ---

72 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
73 DEFINE(UM_POLLIN, POLLIN);
74 DEFINE(UM_POLLPRI, POLLPRI);
75 DEFINE(UM_POLLOUT, POLLOUT);
76
77 DEFINE(UM_PROT_READ, PROT_READ);
78 DEFINE(UM_PROT_WRITE, PROT_WRITE);
79 DEFINE(UM_PROT_EXEC, PROT_EXEC);
23#define DEFINE(sym, val) \
24 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
25
26#define DEFINE_LONGS(sym, val) \
27 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
28
29void foo(void)
30{

--- 53 unchanged lines hidden (view full) ---

84 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
85 DEFINE(UM_POLLIN, POLLIN);
86 DEFINE(UM_POLLPRI, POLLPRI);
87 DEFINE(UM_POLLOUT, POLLOUT);
88
89 DEFINE(UM_PROT_READ, PROT_READ);
90 DEFINE(UM_PROT_WRITE, PROT_WRITE);
91 DEFINE(UM_PROT_EXEC, PROT_EXEC);
92
93 DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
94 DEFINE(NR_syscalls, sizeof(syscalls));
80}
95}