diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-05-02 13:27:12 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:12 -0400 |
commit | a6c4e076ee4c1ea670e4faa55814e63dd08e3f29 (patch) | |
tree | 42ae132ca8ad99b05904af07ed8abc6aeef33aa8 /arch | |
parent | 1353ebb4b48151e3810d9a60449edd43a90ea3c3 (diff) |
[PATCH] i386: clean up identify_cpu
identify_cpu() is used to identify both the boot CPU and secondary
CPUs, but it performs some actions which only apply to the boot CPU.
Those functions are therefore really __init functions, but because
they're called by identify_cpu(), they must be marked __cpuinit.
This patch splits identify_cpu() into identify_boot_cpu() and
identify_secondary_cpu(), and calls the appropriate init functions
from each. Also, identify_boot_cpu() and all the functions it
dominates are marked __init.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 21 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/sysenter.c | 2 |
3 files changed, 16 insertions, 9 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 5faf675aab4b..58128585ae60 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -394,7 +394,7 @@ __setup("serialnumber", x86_serial_nr_setup); | |||
394 | /* | 394 | /* |
395 | * This does the hard work of actually picking apart the CPU stuff... | 395 | * This does the hard work of actually picking apart the CPU stuff... |
396 | */ | 396 | */ |
397 | void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | 397 | static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) |
398 | { | 398 | { |
399 | int i; | 399 | int i; |
400 | 400 | ||
@@ -505,15 +505,22 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
505 | 505 | ||
506 | /* Init Machine Check Exception if available. */ | 506 | /* Init Machine Check Exception if available. */ |
507 | mcheck_init(c); | 507 | mcheck_init(c); |
508 | } | ||
508 | 509 | ||
509 | if (c == &boot_cpu_data) | 510 | void __init identify_boot_cpu(void) |
510 | sysenter_setup(); | 511 | { |
512 | identify_cpu(&boot_cpu_data); | ||
513 | sysenter_setup(); | ||
511 | enable_sep_cpu(); | 514 | enable_sep_cpu(); |
515 | mtrr_bp_init(); | ||
516 | } | ||
512 | 517 | ||
513 | if (c == &boot_cpu_data) | 518 | void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) |
514 | mtrr_bp_init(); | 519 | { |
515 | else | 520 | BUG_ON(c == &boot_cpu_data); |
516 | mtrr_ap_init(); | 521 | identify_cpu(c); |
522 | enable_sep_cpu(); | ||
523 | mtrr_ap_init(); | ||
517 | } | 524 | } |
518 | 525 | ||
519 | #ifdef CONFIG_X86_HT | 526 | #ifdef CONFIG_X86_HT |
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 1c3ad9b406ca..61e2842add36 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -155,7 +155,7 @@ static void __cpuinit smp_store_cpu_info(int id) | |||
155 | 155 | ||
156 | *c = boot_cpu_data; | 156 | *c = boot_cpu_data; |
157 | if (id!=0) | 157 | if (id!=0) |
158 | identify_cpu(c); | 158 | identify_secondary_cpu(c); |
159 | /* | 159 | /* |
160 | * Mask B, Pentium, but not Pentium MMX | 160 | * Mask B, Pentium, but not Pentium MMX |
161 | */ | 161 | */ |
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index 168f8147d3b4..13ca54a85a1c 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c | |||
@@ -72,7 +72,7 @@ extern const char vsyscall_int80_start, vsyscall_int80_end; | |||
72 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; | 72 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; |
73 | static struct page *syscall_pages[1]; | 73 | static struct page *syscall_pages[1]; |
74 | 74 | ||
75 | int __cpuinit sysenter_setup(void) | 75 | int __init sysenter_setup(void) |
76 | { | 76 | { |
77 | void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); | 77 | void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); |
78 | syscall_pages[0] = virt_to_page(syscall_page); | 78 | syscall_pages[0] = virt_to_page(syscall_page); |