diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-04-04 15:41:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:35 -0400 |
commit | 2fe60147570231cde0d1f14711d2e34ccdf54b65 (patch) | |
tree | 83c1e87d9ce3475b68c97f51f95be0467c83a61d | |
parent | 350bae1d3f0d0c763c5bb9cc5fb5c363bd0086db (diff) |
x86: move up & smp variables to setup.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/apic_32.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_32.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_64.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 5 | ||||
-rw-r--r-- | include/asm-x86/smp.h | 3 |
7 files changed, 10 insertions, 35 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 4905a11b30e3..687208190b06 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -52,9 +52,6 @@ | |||
52 | 52 | ||
53 | unsigned long mp_lapic_addr; | 53 | unsigned long mp_lapic_addr; |
54 | 54 | ||
55 | /* Processor that is doing the boot up */ | ||
56 | unsigned int boot_cpu_physical_apicid = -1U; | ||
57 | |||
58 | DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID; | 55 | DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID; |
59 | EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid); | 56 | EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid); |
60 | 57 | ||
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 274ebabf49a2..9e8e5c050c55 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -87,10 +87,6 @@ static unsigned long apic_phys; | |||
87 | 87 | ||
88 | unsigned long mp_lapic_addr; | 88 | unsigned long mp_lapic_addr; |
89 | 89 | ||
90 | /* Processor that is doing the boot up */ | ||
91 | unsigned int boot_cpu_physical_apicid = -1U; | ||
92 | EXPORT_SYMBOL(boot_cpu_physical_apicid); | ||
93 | |||
94 | DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID; | 90 | DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID; |
95 | EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid); | 91 | EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid); |
96 | 92 | ||
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index 2b16e5c71a64..ed4b3bc0e97a 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c | |||
@@ -49,15 +49,6 @@ static int mp_current_pci_id; | |||
49 | 49 | ||
50 | int pic_mode; | 50 | int pic_mode; |
51 | 51 | ||
52 | /* Make it easy to share the UP and SMP code: */ | ||
53 | #ifndef CONFIG_X86_SMP | ||
54 | unsigned int num_processors; | ||
55 | unsigned disabled_cpus __cpuinitdata; | ||
56 | #ifndef CONFIG_X86_LOCAL_APIC | ||
57 | unsigned int boot_cpu_physical_apicid = -1U; | ||
58 | #endif | ||
59 | #endif | ||
60 | |||
61 | /* | 52 | /* |
62 | * Intel MP BIOS table parsing routines: | 53 | * Intel MP BIOS table parsing routines: |
63 | */ | 54 | */ |
@@ -93,9 +84,7 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | |||
93 | int apicid; | 84 | int apicid; |
94 | 85 | ||
95 | if (!(m->mpc_cpuflag & CPU_ENABLED)) { | 86 | if (!(m->mpc_cpuflag & CPU_ENABLED)) { |
96 | #ifdef CONFIG_X86_SMP | ||
97 | disabled_cpus++; | 87 | disabled_cpus++; |
98 | #endif | ||
99 | return; | 88 | return; |
100 | } | 89 | } |
101 | 90 | ||
@@ -817,9 +806,7 @@ void __cpuinit mp_register_lapic (int id, u8 enabled) | |||
817 | } | 806 | } |
818 | 807 | ||
819 | if (!enabled) { | 808 | if (!enabled) { |
820 | #ifdef CONFIG_X86_SMP | ||
821 | ++disabled_cpus; | 809 | ++disabled_cpus; |
822 | #endif | ||
823 | return; | 810 | return; |
824 | } | 811 | } |
825 | 812 | ||
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c index 07c98dbd468a..f860727e9151 100644 --- a/arch/x86/kernel/mpparse_64.c +++ b/arch/x86/kernel/mpparse_64.c | |||
@@ -45,15 +45,6 @@ int mp_bus_id_to_pci_bus[MAX_MP_BUSSES] = {[0 ... MAX_MP_BUSSES - 1] = -1 }; | |||
45 | 45 | ||
46 | static int mp_current_pci_id = 0; | 46 | static int mp_current_pci_id = 0; |
47 | 47 | ||
48 | /* Make it easy to share the UP and SMP code: */ | ||
49 | #ifndef CONFIG_X86_SMP | ||
50 | unsigned int num_processors; | ||
51 | unsigned disabled_cpus __cpuinitdata; | ||
52 | #ifndef CONFIG_X86_LOCAL_APIC | ||
53 | unsigned int boot_cpu_physical_apicid = -1U; | ||
54 | #endif | ||
55 | #endif | ||
56 | |||
57 | /* | 48 | /* |
58 | * Intel MP BIOS table parsing routines: | 49 | * Intel MP BIOS table parsing routines: |
59 | */ | 50 | */ |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 011fcdd213ff..ed157c90412e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -12,6 +12,14 @@ | |||
12 | #include <asm/mpspec.h> | 12 | #include <asm/mpspec.h> |
13 | #include <asm/apicdef.h> | 13 | #include <asm/apicdef.h> |
14 | 14 | ||
15 | unsigned int num_processors; | ||
16 | unsigned disabled_cpus __cpuinitdata; | ||
17 | /* Processor that is doing the boot up */ | ||
18 | unsigned int boot_cpu_physical_apicid = -1U; | ||
19 | EXPORT_SYMBOL(boot_cpu_physical_apicid); | ||
20 | |||
21 | physid_mask_t phys_cpu_present_map; | ||
22 | |||
15 | DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID; | 23 | DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID; |
16 | EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); | 24 | EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); |
17 | 25 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index abf63767cd46..21ad3f396a05 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -86,14 +86,9 @@ void *x86_bios_cpu_apicid_early_ptr; | |||
86 | u8 apicid_2_node[MAX_APICID]; | 86 | u8 apicid_2_node[MAX_APICID]; |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | /* Internal processor count */ | ||
90 | unsigned int num_processors; | ||
91 | |||
92 | /* State of each CPU */ | 89 | /* State of each CPU */ |
93 | DEFINE_PER_CPU(int, cpu_state) = { 0 }; | 90 | DEFINE_PER_CPU(int, cpu_state) = { 0 }; |
94 | 91 | ||
95 | unsigned disabled_cpus __cpuinitdata; | ||
96 | |||
97 | /* Store all idle threads, this can be reused instead of creating | 92 | /* Store all idle threads, this can be reused instead of creating |
98 | * a new thread. Also avoids complicated thread destroy functionality | 93 | * a new thread. Also avoids complicated thread destroy functionality |
99 | * for idle threads. | 94 | * for idle threads. |
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h index d973c11688ce..3496e1c299b2 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h | |||
@@ -128,7 +128,6 @@ int native_cpu_up(unsigned int cpunum); | |||
128 | extern int __cpu_disable(void); | 128 | extern int __cpu_disable(void); |
129 | extern void __cpu_die(unsigned int cpu); | 129 | extern void __cpu_die(unsigned int cpu); |
130 | 130 | ||
131 | extern unsigned disabled_cpus; | ||
132 | extern void prefill_possible_map(void); | 131 | extern void prefill_possible_map(void); |
133 | 132 | ||
134 | #define SMP_TRAMPOLINE_BASE 0x6000 | 133 | #define SMP_TRAMPOLINE_BASE 0x6000 |
@@ -144,6 +143,8 @@ static inline int num_booting_cpus(void) | |||
144 | } | 143 | } |
145 | #endif /* CONFIG_SMP */ | 144 | #endif /* CONFIG_SMP */ |
146 | 145 | ||
146 | extern unsigned disabled_cpus __cpuinitdata; | ||
147 | |||
147 | #ifdef CONFIG_X86_32_SMP | 148 | #ifdef CONFIG_X86_32_SMP |
148 | /* | 149 | /* |
149 | * This function is needed by all SMP systems. It must _always_ be valid | 150 | * This function is needed by all SMP systems. It must _always_ be valid |