diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-03-27 16:55:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:31 -0400 |
commit | 903dcb5a1bd0ef2b09d756f646e367cd12659b6f (patch) | |
tree | 393e4d0a10d183406e3d68a28045462cb611b45d /arch/x86 | |
parent | acff5a768935f7f39e4e3be03940d70c005ffe96 (diff) |
x86: move generic_processor_info to apic_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic_32.c | 82 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_32.c | 81 |
2 files changed, 82 insertions, 81 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 65036bbaf058..a99398f71234 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1469,6 +1469,88 @@ void disconnect_bsp_APIC(int virt_wire_setup) | |||
1469 | } | 1469 | } |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | unsigned int __cpuinitdata maxcpus = NR_CPUS; | ||
1473 | |||
1474 | void __cpuinit generic_processor_info(int apicid, int version) | ||
1475 | { | ||
1476 | int cpu; | ||
1477 | cpumask_t tmp_map; | ||
1478 | physid_mask_t phys_cpu; | ||
1479 | |||
1480 | /* | ||
1481 | * Validate version | ||
1482 | */ | ||
1483 | if (version == 0x0) { | ||
1484 | printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! " | ||
1485 | "fixing up to 0x10. (tell your hw vendor)\n", | ||
1486 | version); | ||
1487 | version = 0x10; | ||
1488 | } | ||
1489 | apic_version[apicid] = version; | ||
1490 | |||
1491 | phys_cpu = apicid_to_cpu_present(apicid); | ||
1492 | physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu); | ||
1493 | |||
1494 | if (num_processors >= NR_CPUS) { | ||
1495 | printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." | ||
1496 | " Processor ignored.\n", NR_CPUS); | ||
1497 | return; | ||
1498 | } | ||
1499 | |||
1500 | if (num_processors >= maxcpus) { | ||
1501 | printk(KERN_WARNING "WARNING: maxcpus limit of %i reached." | ||
1502 | " Processor ignored.\n", maxcpus); | ||
1503 | return; | ||
1504 | } | ||
1505 | |||
1506 | num_processors++; | ||
1507 | cpus_complement(tmp_map, cpu_present_map); | ||
1508 | cpu = first_cpu(tmp_map); | ||
1509 | |||
1510 | if (apicid == boot_cpu_physical_apicid) | ||
1511 | /* | ||
1512 | * x86_bios_cpu_apicid is required to have processors listed | ||
1513 | * in same order as logical cpu numbers. Hence the first | ||
1514 | * entry is BSP, and so on. | ||
1515 | */ | ||
1516 | cpu = 0; | ||
1517 | |||
1518 | /* | ||
1519 | * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y | ||
1520 | * but we need to work other dependencies like SMP_SUSPEND etc | ||
1521 | * before this can be done without some confusion. | ||
1522 | * if (CPU_HOTPLUG_ENABLED || num_processors > 8) | ||
1523 | * - Ashok Raj <ashok.raj@intel.com> | ||
1524 | */ | ||
1525 | if (num_processors > 8) { | ||
1526 | switch (boot_cpu_data.x86_vendor) { | ||
1527 | case X86_VENDOR_INTEL: | ||
1528 | if (!APIC_XAPIC(version)) { | ||
1529 | def_to_bigsmp = 0; | ||
1530 | break; | ||
1531 | } | ||
1532 | /* If P4 and above fall through */ | ||
1533 | case X86_VENDOR_AMD: | ||
1534 | def_to_bigsmp = 1; | ||
1535 | } | ||
1536 | } | ||
1537 | #ifdef CONFIG_SMP | ||
1538 | /* are we being called early in kernel startup? */ | ||
1539 | if (x86_cpu_to_apicid_early_ptr) { | ||
1540 | u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr; | ||
1541 | u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr; | ||
1542 | |||
1543 | cpu_to_apicid[cpu] = apicid; | ||
1544 | bios_cpu_apicid[cpu] = apicid; | ||
1545 | } else { | ||
1546 | per_cpu(x86_cpu_to_apicid, cpu) = apicid; | ||
1547 | per_cpu(x86_bios_cpu_apicid, cpu) = apicid; | ||
1548 | } | ||
1549 | #endif | ||
1550 | cpu_set(cpu, cpu_possible_map); | ||
1551 | cpu_set(cpu, cpu_present_map); | ||
1552 | } | ||
1553 | |||
1472 | /* | 1554 | /* |
1473 | * Power management | 1555 | * Power management |
1474 | */ | 1556 | */ |
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index c79d6e06c3fa..cd4522b3e90e 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c | |||
@@ -35,7 +35,6 @@ | |||
35 | 35 | ||
36 | /* Have we found an MP table */ | 36 | /* Have we found an MP table */ |
37 | int smp_found_config; | 37 | int smp_found_config; |
38 | unsigned int __cpuinitdata maxcpus = NR_CPUS; | ||
39 | 38 | ||
40 | /* | 39 | /* |
41 | * Various Linux-internal data structures created from the | 40 | * Various Linux-internal data structures created from the |
@@ -105,86 +104,6 @@ static int mpc_record; | |||
105 | static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinitdata; | 104 | static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinitdata; |
106 | #endif | 105 | #endif |
107 | 106 | ||
108 | static void __cpuinit generic_processor_info(int apicid, int version) | ||
109 | { | ||
110 | int cpu; | ||
111 | cpumask_t tmp_map; | ||
112 | physid_mask_t phys_cpu; | ||
113 | |||
114 | /* | ||
115 | * Validate version | ||
116 | */ | ||
117 | if (version == 0x0) { | ||
118 | printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! " | ||
119 | "fixing up to 0x10. (tell your hw vendor)\n", | ||
120 | version); | ||
121 | version = 0x10; | ||
122 | } | ||
123 | apic_version[apicid] = version; | ||
124 | |||
125 | phys_cpu = apicid_to_cpu_present(apicid); | ||
126 | physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu); | ||
127 | |||
128 | if (num_processors >= NR_CPUS) { | ||
129 | printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." | ||
130 | " Processor ignored.\n", NR_CPUS); | ||
131 | return; | ||
132 | } | ||
133 | |||
134 | if (num_processors >= maxcpus) { | ||
135 | printk(KERN_WARNING "WARNING: maxcpus limit of %i reached." | ||
136 | " Processor ignored.\n", maxcpus); | ||
137 | return; | ||
138 | } | ||
139 | |||
140 | num_processors++; | ||
141 | cpus_complement(tmp_map, cpu_present_map); | ||
142 | cpu = first_cpu(tmp_map); | ||
143 | |||
144 | if (apicid == boot_cpu_physical_apicid) | ||
145 | /* | ||
146 | * x86_bios_cpu_apicid is required to have processors listed | ||
147 | * in same order as logical cpu numbers. Hence the first | ||
148 | * entry is BSP, and so on. | ||
149 | */ | ||
150 | cpu = 0; | ||
151 | |||
152 | /* | ||
153 | * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y | ||
154 | * but we need to work other dependencies like SMP_SUSPEND etc | ||
155 | * before this can be done without some confusion. | ||
156 | * if (CPU_HOTPLUG_ENABLED || num_processors > 8) | ||
157 | * - Ashok Raj <ashok.raj@intel.com> | ||
158 | */ | ||
159 | if (num_processors > 8) { | ||
160 | switch (boot_cpu_data.x86_vendor) { | ||
161 | case X86_VENDOR_INTEL: | ||
162 | if (!APIC_XAPIC(version)) { | ||
163 | def_to_bigsmp = 0; | ||
164 | break; | ||
165 | } | ||
166 | /* If P4 and above fall through */ | ||
167 | case X86_VENDOR_AMD: | ||
168 | def_to_bigsmp = 1; | ||
169 | } | ||
170 | } | ||
171 | #ifdef CONFIG_SMP | ||
172 | /* are we being called early in kernel startup? */ | ||
173 | if (x86_cpu_to_apicid_early_ptr) { | ||
174 | u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr; | ||
175 | u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr; | ||
176 | |||
177 | cpu_to_apicid[cpu] = apicid; | ||
178 | bios_cpu_apicid[cpu] = apicid; | ||
179 | } else { | ||
180 | per_cpu(x86_cpu_to_apicid, cpu) = apicid; | ||
181 | per_cpu(x86_bios_cpu_apicid, cpu) = apicid; | ||
182 | } | ||
183 | #endif | ||
184 | cpu_set(cpu, cpu_possible_map); | ||
185 | cpu_set(cpu, cpu_present_map); | ||
186 | } | ||
187 | |||
188 | static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | 107 | static void __cpuinit MP_processor_info(struct mpc_config_processor *m) |
189 | { | 108 | { |
190 | int apicid; | 109 | int apicid; |