1
2
3
4
5
6
7
8
9
10
11
12
13
14__asm__ (".if 0");
15
16#include <linux/sched.h>
17#include <linux/ptrace.h>
18#include <asm/processor.h>
19
20
21#undef VAL
22#define VAL(NAME, VALUE) \
23void NAME ## _fun (void) \
24 { \
25 __asm__ (".endif \n" \
26 #NAME " = %0 \n" \
27 ".if 0\n" \
28 : : "i" (VALUE)); \
29 }
30
31#undef OF
32#define OF(NAME, TYPE, MEMBER) \
33 VAL (NAME, offsetof (TYPE, MEMBER))
34
35
36OF (LTASK_SIGPENDING, struct task_struct, sigpending)
37OF (LTASK_NEEDRESCHED, struct task_struct, need_resched)
38OF (LTASK_PTRACE, struct task_struct, ptrace)
39OF (LTASK_PID, struct task_struct, pid)
40
41
42OF (LORIG_R10, struct pt_regs, orig_r10)
43OF (LR13, struct pt_regs, r13)
44OF (LR12, struct pt_regs, r12)
45OF (LR11, struct pt_regs, r11)
46OF (LR10, struct pt_regs, r10)
47OF (LR9, struct pt_regs, r9)
48OF (LMOF, struct pt_regs, mof)
49OF (LDCCR, struct pt_regs, dccr)
50OF (LSRP, struct pt_regs, srp)
51OF (LIRP, struct pt_regs, irp)
52
53
54OF (LTHREAD_KSP, struct thread_struct, ksp)
55OF (LTHREAD_USP, struct thread_struct, usp)
56OF (LTHREAD_DCCR, struct thread_struct, dccr)
57
58
59VAL (LCLONE_VM, CLONE_VM)
60
61__asm__ (".endif");
62