xref: /linux/arch/x86/kernel/asm-offsets.c (revision 291f36325f9f252bd76ef5f603995f37e453fc60)
1b82fef82SJan Beulich /*
2b82fef82SJan Beulich  * Generate definitions needed by assembly language modules.
3b82fef82SJan Beulich  * This code generates raw asm output which is post-processed to extract
4b82fef82SJan Beulich  * and format the required data.
5b82fef82SJan Beulich  */
6b82fef82SJan Beulich #define COMPILE_OFFSETS
7b82fef82SJan Beulich 
8b82fef82SJan Beulich #include <linux/crypto.h>
9b82fef82SJan Beulich #include <linux/sched.h>
10b82fef82SJan Beulich #include <linux/stddef.h>
11b82fef82SJan Beulich #include <linux/hardirq.h>
12b82fef82SJan Beulich #include <linux/suspend.h>
13b82fef82SJan Beulich #include <linux/kbuild.h>
14b82fef82SJan Beulich #include <asm/processor.h>
15b82fef82SJan Beulich #include <asm/thread_info.h>
16b82fef82SJan Beulich #include <asm/sigframe.h>
17b82fef82SJan Beulich #include <asm/bootparam.h>
18b82fef82SJan Beulich #include <asm/suspend.h>
19b82fef82SJan Beulich 
20b82fef82SJan Beulich #ifdef CONFIG_XEN
21b82fef82SJan Beulich #include <xen/interface/xen.h>
22b82fef82SJan Beulich #endif
23b82fef82SJan Beulich 
249a163ed8SThomas Gleixner #ifdef CONFIG_X86_32
259a163ed8SThomas Gleixner # include "asm-offsets_32.c"
269a163ed8SThomas Gleixner #else
279a163ed8SThomas Gleixner # include "asm-offsets_64.c"
289a163ed8SThomas Gleixner #endif
29b82fef82SJan Beulich 
30b82fef82SJan Beulich void common(void) {
31b82fef82SJan Beulich 	BLANK();
32b82fef82SJan Beulich 	OFFSET(TI_flags, thread_info, flags);
33b82fef82SJan Beulich 	OFFSET(TI_status, thread_info, status);
34b82fef82SJan Beulich 	OFFSET(TI_addr_limit, thread_info, addr_limit);
35b82fef82SJan Beulich 	OFFSET(TI_preempt_count, thread_info, preempt_count);
36b82fef82SJan Beulich 
37b82fef82SJan Beulich 	BLANK();
38b82fef82SJan Beulich 	OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
39b82fef82SJan Beulich 
40b82fef82SJan Beulich 	BLANK();
41b82fef82SJan Beulich 	OFFSET(pbe_address, pbe, address);
42b82fef82SJan Beulich 	OFFSET(pbe_orig_address, pbe, orig_address);
43b82fef82SJan Beulich 	OFFSET(pbe_next, pbe, next);
44b82fef82SJan Beulich 
45b82fef82SJan Beulich #ifdef CONFIG_PARAVIRT
46b82fef82SJan Beulich 	BLANK();
47b82fef82SJan Beulich 	OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
48b82fef82SJan Beulich 	OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
49b82fef82SJan Beulich 	OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
50b82fef82SJan Beulich 	OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
51b82fef82SJan Beulich 	OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
52b82fef82SJan Beulich 	OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
53b82fef82SJan Beulich 	OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
54b82fef82SJan Beulich 	OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
55b82fef82SJan Beulich 	OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
56b82fef82SJan Beulich #endif
57b82fef82SJan Beulich 
58b82fef82SJan Beulich #ifdef CONFIG_XEN
59b82fef82SJan Beulich 	BLANK();
60b82fef82SJan Beulich 	OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
61b82fef82SJan Beulich 	OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
62b82fef82SJan Beulich #endif
63b82fef82SJan Beulich 
64b82fef82SJan Beulich 	BLANK();
65b82fef82SJan Beulich 	OFFSET(BP_scratch, boot_params, scratch);
66b82fef82SJan Beulich 	OFFSET(BP_loadflags, boot_params, hdr.loadflags);
67b82fef82SJan Beulich 	OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
68b82fef82SJan Beulich 	OFFSET(BP_version, boot_params, hdr.version);
69b82fef82SJan Beulich 	OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
70*291f3632SMatt Fleming 	OFFSET(BP_pref_address, boot_params, hdr.pref_address);
71*291f3632SMatt Fleming 	OFFSET(BP_code32_start, boot_params, hdr.code32_start);
72b82fef82SJan Beulich }
73