aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2015-04-12 09:14:45 -0400
committerIngo Molnar <mingo@kernel.org>2015-04-15 05:28:49 -0400
commit4d178f94ebe123d462a51169b53854cb7f198888 (patch)
tree6b48de9f1d7445f8b662d49e1ee51dbc253d1702
parent6a16dda86ebbcfe690c753c3fb469b4f9ad5a5ef (diff)
x86/asm: Merge common 32-bit values in asm-offsets.c
Merge common values for 32-bit native and compat. Signed-off-by: Brian Gerst <brgerst@gmail.com> Acked-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Denys Vlasenko <dvlasenk@redhat.com> Link: http://lkml.kernel.org/r/1428844486-6638-1-git-send-email-brgerst@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/asm-offsets.c19
-rw-r--r--arch/x86/kernel/asm-offsets_32.c15
-rw-r--r--arch/x86/kernel/asm-offsets_64.c21
3 files changed, 19 insertions, 36 deletions
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index 9f6b9341950f..b27f6ec90caa 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -41,6 +41,25 @@ void common(void) {
41 OFFSET(pbe_orig_address, pbe, orig_address); 41 OFFSET(pbe_orig_address, pbe, orig_address);
42 OFFSET(pbe_next, pbe, next); 42 OFFSET(pbe_next, pbe, next);
43 43
44#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
45 BLANK();
46 OFFSET(IA32_SIGCONTEXT_ax, sigcontext_ia32, ax);
47 OFFSET(IA32_SIGCONTEXT_bx, sigcontext_ia32, bx);
48 OFFSET(IA32_SIGCONTEXT_cx, sigcontext_ia32, cx);
49 OFFSET(IA32_SIGCONTEXT_dx, sigcontext_ia32, dx);
50 OFFSET(IA32_SIGCONTEXT_si, sigcontext_ia32, si);
51 OFFSET(IA32_SIGCONTEXT_di, sigcontext_ia32, di);
52 OFFSET(IA32_SIGCONTEXT_bp, sigcontext_ia32, bp);
53 OFFSET(IA32_SIGCONTEXT_sp, sigcontext_ia32, sp);
54 OFFSET(IA32_SIGCONTEXT_ip, sigcontext_ia32, ip);
55
56 BLANK();
57 OFFSET(TI_sysenter_return, thread_info, sysenter_return);
58
59 BLANK();
60 OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
61#endif
62
44#ifdef CONFIG_PARAVIRT 63#ifdef CONFIG_PARAVIRT
45 BLANK(); 64 BLANK();
46 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); 65 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 47703aed74cf..628bfd4c06bb 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -17,17 +17,6 @@ void foo(void);
17 17
18void foo(void) 18void foo(void)
19{ 19{
20 OFFSET(IA32_SIGCONTEXT_ax, sigcontext, ax);
21 OFFSET(IA32_SIGCONTEXT_bx, sigcontext, bx);
22 OFFSET(IA32_SIGCONTEXT_cx, sigcontext, cx);
23 OFFSET(IA32_SIGCONTEXT_dx, sigcontext, dx);
24 OFFSET(IA32_SIGCONTEXT_si, sigcontext, si);
25 OFFSET(IA32_SIGCONTEXT_di, sigcontext, di);
26 OFFSET(IA32_SIGCONTEXT_bp, sigcontext, bp);
27 OFFSET(IA32_SIGCONTEXT_sp, sigcontext, sp);
28 OFFSET(IA32_SIGCONTEXT_ip, sigcontext, ip);
29 BLANK();
30
31 OFFSET(CPUINFO_x86, cpuinfo_x86, x86); 20 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
32 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); 21 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
33 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); 22 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
@@ -37,7 +26,6 @@ void foo(void)
37 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); 26 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
38 BLANK(); 27 BLANK();
39 28
40 OFFSET(TI_sysenter_return, thread_info, sysenter_return);
41 OFFSET(TI_cpu, thread_info, cpu); 29 OFFSET(TI_cpu, thread_info, cpu);
42 BLANK(); 30 BLANK();
43 31
@@ -60,9 +48,6 @@ void foo(void)
60 OFFSET(PT_OLDSS, pt_regs, ss); 48 OFFSET(PT_OLDSS, pt_regs, ss);
61 BLANK(); 49 BLANK();
62 50
63 OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
64 BLANK();
65
66 OFFSET(saved_context_gdt_desc, saved_context, gdt_desc); 51 OFFSET(saved_context_gdt_desc, saved_context, gdt_desc);
67 BLANK(); 52 BLANK();
68 53
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 5ce6f2da8763..dcaab87da629 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -29,27 +29,6 @@ int main(void)
29 BLANK(); 29 BLANK();
30#endif 30#endif
31 31
32#ifdef CONFIG_IA32_EMULATION
33 OFFSET(TI_sysenter_return, thread_info, sysenter_return);
34 BLANK();
35
36#define ENTRY(entry) OFFSET(IA32_SIGCONTEXT_ ## entry, sigcontext_ia32, entry)
37 ENTRY(ax);
38 ENTRY(bx);
39 ENTRY(cx);
40 ENTRY(dx);
41 ENTRY(si);
42 ENTRY(di);
43 ENTRY(bp);
44 ENTRY(sp);
45 ENTRY(ip);
46 BLANK();
47#undef ENTRY
48
49 OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
50 BLANK();
51#endif
52
53#define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry) 32#define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry)
54 ENTRY(bx); 33 ENTRY(bx);
55 ENTRY(cx); 34 ENTRY(cx);