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.
7 #include <linux/crypto.h>
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>
14 #include <asm/fixmap.h>
15 #include <asm/processor.h>
16 #include <asm/thread_info.h>
18 #define DEFINE(sym, val) \
19 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
21 #define BLANK() asm volatile("\n->" : : )
23 #define OFFSET(sym, str, mem) \
24 DEFINE(sym, offsetof(struct str, mem));
28 OFFSET(SIGCONTEXT_eax, sigcontext, eax);
29 OFFSET(SIGCONTEXT_ebx, sigcontext, ebx);
30 OFFSET(SIGCONTEXT_ecx, sigcontext, ecx);
31 OFFSET(SIGCONTEXT_edx, sigcontext, edx);
32 OFFSET(SIGCONTEXT_esi, sigcontext, esi);
33 OFFSET(SIGCONTEXT_edi, sigcontext, edi);
34 OFFSET(SIGCONTEXT_ebp, sigcontext, ebp);
35 OFFSET(SIGCONTEXT_esp, sigcontext, esp);
36 OFFSET(SIGCONTEXT_eip, sigcontext, eip);
39 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
40 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
41 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
42 OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);
43 OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math);
44 OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
45 OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
46 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
49 OFFSET(TI_task, thread_info, task);
50 OFFSET(TI_exec_domain, thread_info, exec_domain);
51 OFFSET(TI_flags, thread_info, flags);
52 OFFSET(TI_status, thread_info, status);
53 OFFSET(TI_cpu, thread_info, cpu);
54 OFFSET(TI_preempt_count, thread_info, preempt_count);
55 OFFSET(TI_addr_limit, thread_info, addr_limit);
56 OFFSET(TI_restart_block, thread_info, restart_block);
59 OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
60 OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
63 OFFSET(pbe_address, pbe, address);
64 OFFSET(pbe_orig_address, pbe, orig_address);
65 OFFSET(pbe_next, pbe, next);
67 /* Offset from the sysenter stack to tss.esp0 */
68 DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) -
69 sizeof(struct tss_struct));
71 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
72 DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL));
74 OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);