]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Generate definitions needed by assembly language modules. | |
3 | * This code generates raw asm output which is post-processed | |
4 | * to extract and format the required data. | |
5 | */ | |
6 | ||
6c2bb98b | 7 | #include <linux/crypto.h> |
1da177e4 LT |
8 | #include <linux/sched.h> |
9 | #include <linux/signal.h> | |
10 | #include <linux/personality.h> | |
11 | #include <linux/suspend.h> | |
12 | #include <asm/ucontext.h> | |
13 | #include "sigframe.h" | |
14 | #include <asm/fixmap.h> | |
15 | #include <asm/processor.h> | |
16 | #include <asm/thread_info.h> | |
e6e5494c | 17 | #include <asm/elf.h> |
1da177e4 LT |
18 | |
19 | #define DEFINE(sym, val) \ | |
20 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | |
21 | ||
22 | #define BLANK() asm volatile("\n->" : : ) | |
23 | ||
24 | #define OFFSET(sym, str, mem) \ | |
25 | DEFINE(sym, offsetof(struct str, mem)); | |
26 | ||
27142219 AB |
27 | /* workaround for a warning with -Wmissing-prototypes */ |
28 | void foo(void); | |
29 | ||
1da177e4 LT |
30 | void foo(void) |
31 | { | |
32 | OFFSET(SIGCONTEXT_eax, sigcontext, eax); | |
33 | OFFSET(SIGCONTEXT_ebx, sigcontext, ebx); | |
34 | OFFSET(SIGCONTEXT_ecx, sigcontext, ecx); | |
35 | OFFSET(SIGCONTEXT_edx, sigcontext, edx); | |
36 | OFFSET(SIGCONTEXT_esi, sigcontext, esi); | |
37 | OFFSET(SIGCONTEXT_edi, sigcontext, edi); | |
38 | OFFSET(SIGCONTEXT_ebp, sigcontext, ebp); | |
39 | OFFSET(SIGCONTEXT_esp, sigcontext, esp); | |
40 | OFFSET(SIGCONTEXT_eip, sigcontext, eip); | |
41 | BLANK(); | |
42 | ||
43 | OFFSET(CPUINFO_x86, cpuinfo_x86, x86); | |
44 | OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); | |
45 | OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); | |
46 | OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); | |
47 | OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math); | |
48 | OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); | |
49 | OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); | |
50 | OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); | |
51 | BLANK(); | |
52 | ||
53 | OFFSET(TI_task, thread_info, task); | |
54 | OFFSET(TI_exec_domain, thread_info, exec_domain); | |
55 | OFFSET(TI_flags, thread_info, flags); | |
56 | OFFSET(TI_status, thread_info, status); | |
1da177e4 LT |
57 | OFFSET(TI_preempt_count, thread_info, preempt_count); |
58 | OFFSET(TI_addr_limit, thread_info, addr_limit); | |
59 | OFFSET(TI_restart_block, thread_info, restart_block); | |
e6e5494c | 60 | OFFSET(TI_sysenter_return, thread_info, sysenter_return); |
1da177e4 LT |
61 | BLANK(); |
62 | ||
be44d2aa SS |
63 | OFFSET(GDS_size, Xgt_desc_struct, size); |
64 | OFFSET(GDS_address, Xgt_desc_struct, address); | |
65 | OFFSET(GDS_pad, Xgt_desc_struct, pad); | |
66 | BLANK(); | |
67 | ||
eb5b7b9d JF |
68 | OFFSET(PT_EBX, pt_regs, ebx); |
69 | OFFSET(PT_ECX, pt_regs, ecx); | |
70 | OFFSET(PT_EDX, pt_regs, edx); | |
71 | OFFSET(PT_ESI, pt_regs, esi); | |
72 | OFFSET(PT_EDI, pt_regs, edi); | |
73 | OFFSET(PT_EBP, pt_regs, ebp); | |
74 | OFFSET(PT_EAX, pt_regs, eax); | |
75 | OFFSET(PT_DS, pt_regs, xds); | |
76 | OFFSET(PT_ES, pt_regs, xes); | |
464d1a78 | 77 | OFFSET(PT_FS, pt_regs, xfs); |
eb5b7b9d JF |
78 | OFFSET(PT_ORIG_EAX, pt_regs, orig_eax); |
79 | OFFSET(PT_EIP, pt_regs, eip); | |
80 | OFFSET(PT_CS, pt_regs, xcs); | |
81 | OFFSET(PT_EFLAGS, pt_regs, eflags); | |
82 | OFFSET(PT_OLDESP, pt_regs, esp); | |
83 | OFFSET(PT_OLDSS, pt_regs, xss); | |
84 | BLANK(); | |
85 | ||
1da177e4 LT |
86 | OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); |
87 | OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); | |
88 | BLANK(); | |
89 | ||
90 | OFFSET(pbe_address, pbe, address); | |
91 | OFFSET(pbe_orig_address, pbe, orig_address); | |
92 | OFFSET(pbe_next, pbe, next); | |
93 | ||
94 | /* Offset from the sysenter stack to tss.esp0 */ | |
a75c54f9 | 95 | DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - |
1da177e4 LT |
96 | sizeof(struct tss_struct)); |
97 | ||
98 | DEFINE(PAGE_SIZE_asm, PAGE_SIZE); | |
1b523fb5 | 99 | DEFINE(VDSO_PRELINK_asm, VDSO_PRELINK); |
6c2bb98b HX |
100 | |
101 | OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); | |
b2938f88 | 102 | |
d3561b7f RR |
103 | #ifdef CONFIG_PARAVIRT |
104 | BLANK(); | |
105 | OFFSET(PARAVIRT_enabled, paravirt_ops, paravirt_enabled); | |
106 | OFFSET(PARAVIRT_irq_disable, paravirt_ops, irq_disable); | |
107 | OFFSET(PARAVIRT_irq_enable, paravirt_ops, irq_enable); | |
108 | OFFSET(PARAVIRT_irq_enable_sysexit, paravirt_ops, irq_enable_sysexit); | |
109 | OFFSET(PARAVIRT_iret, paravirt_ops, iret); | |
110 | OFFSET(PARAVIRT_read_cr0, paravirt_ops, read_cr0); | |
111 | #endif | |
1da177e4 | 112 | } |