aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2011-02-09 03:24:34 -0500
committerIngo Molnar <mingo@elte.hu>2011-02-10 07:31:37 -0500
commitb82fef82d56789439e6be638a87a1a5bba1e6e75 (patch)
treeabe25445409077016ad8530cd875c15dabb87306 /arch/x86/kernel/asm-offsets.c
parent94d1ac8b55799be10487fff9766cce6d6628462a (diff)
x86: Partly unify asm-offsets_{32,64}.c
Just consolidating the common parts. Full unification would seem straight forward, but it's not clear the necessary #ifdef-s would be acceptable. Signed-off-by: Jan Beulich <jbeulich@novell.com> LKML-Reference: <4D525D520200007800030EE9@vpn.id2.novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/asm-offsets.c')
-rw-r--r--arch/x86/kernel/asm-offsets.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index cfa82c899f47..2b141c1915a5 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -1,5 +1,75 @@
1/*
2 * Generate definitions needed by assembly language modules.
3 * This code generates raw asm output which is post-processed to extract
4 * and format the required data.
5 */
6#define COMPILE_OFFSETS
7
8#include <linux/crypto.h>
9#include <linux/sched.h>
10#include <linux/stddef.h>
11#include <linux/hardirq.h>
12#include <linux/suspend.h>
13#include <linux/kbuild.h>
14#include <asm/processor.h>
15#include <asm/thread_info.h>
16#include <asm/sigframe.h>
17#include <asm/bootparam.h>
18#include <asm/suspend.h>
19
20#ifdef CONFIG_XEN
21#include <xen/interface/xen.h>
22#endif
23
1#ifdef CONFIG_X86_32 24#ifdef CONFIG_X86_32
2# include "asm-offsets_32.c" 25# include "asm-offsets_32.c"
3#else 26#else
4# include "asm-offsets_64.c" 27# include "asm-offsets_64.c"
5#endif 28#endif
29
30void common(void) {
31 BLANK();
32 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
33 DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
34 DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
35
36 BLANK();
37 OFFSET(TI_flags, thread_info, flags);
38 OFFSET(TI_status, thread_info, status);
39 OFFSET(TI_addr_limit, thread_info, addr_limit);
40 OFFSET(TI_preempt_count, thread_info, preempt_count);
41
42 BLANK();
43 OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
44
45 BLANK();
46 OFFSET(pbe_address, pbe, address);
47 OFFSET(pbe_orig_address, pbe, orig_address);
48 OFFSET(pbe_next, pbe, next);
49
50#ifdef CONFIG_PARAVIRT
51 BLANK();
52 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
53 OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
54 OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
55 OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
56 OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
57 OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
58 OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
59 OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
60 OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
61#endif
62
63#ifdef CONFIG_XEN
64 BLANK();
65 OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
66 OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
67#endif
68
69 BLANK();
70 OFFSET(BP_scratch, boot_params, scratch);
71 OFFSET(BP_loadflags, boot_params, hdr.loadflags);
72 OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
73 OFFSET(BP_version, boot_params, hdr.version);
74 OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
75}