aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-03-27 16:56:19 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:32 -0400
commitbe8a5685e4cdb904e6542e741fcc3bae1becb8ee (patch)
treef619c2f1cdda9d780caec7e33c8b1de896469700 /arch/x86/kernel
parent86cc0d916a9cc55b0b46a9b31e9379cd3c9e10dc (diff)
x86: move generic_processor_info to apic_64.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apic_64.c47
-rw-r--r--arch/x86/kernel/mpparse_64.c49
2 files changed, 48 insertions, 48 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index d7d3594f93e3..4ee521ff0a3e 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -91,6 +91,7 @@ unsigned long mp_lapic_addr;
91unsigned int boot_cpu_physical_apicid = -1U; 91unsigned int boot_cpu_physical_apicid = -1U;
92EXPORT_SYMBOL(boot_cpu_physical_apicid); 92EXPORT_SYMBOL(boot_cpu_physical_apicid);
93 93
94unsigned int __cpuinitdata maxcpus = NR_CPUS;
94/* 95/*
95 * Get the LAPIC version 96 * Get the LAPIC version
96 */ 97 */
@@ -1057,6 +1058,52 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1057 apic_write(APIC_LVT1, value); 1058 apic_write(APIC_LVT1, value);
1058} 1059}
1059 1060
1061void __cpuinit generic_processor_info(int apicid, int version)
1062{
1063 int cpu;
1064 cpumask_t tmp_map;
1065
1066 if (num_processors >= NR_CPUS) {
1067 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
1068 " Processor ignored.\n", NR_CPUS);
1069 return;
1070 }
1071
1072 if (num_processors >= maxcpus) {
1073 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
1074 " Processor ignored.\n", maxcpus);
1075 return;
1076 }
1077
1078 num_processors++;
1079 cpus_complement(tmp_map, cpu_present_map);
1080 cpu = first_cpu(tmp_map);
1081
1082 physid_set(apicid, phys_cpu_present_map);
1083 if (apicid == boot_cpu_physical_apicid) {
1084 /*
1085 * x86_bios_cpu_apicid is required to have processors listed
1086 * in same order as logical cpu numbers. Hence the first
1087 * entry is BSP, and so on.
1088 */
1089 cpu = 0;
1090 }
1091 /* are we being called early in kernel startup? */
1092 if (x86_cpu_to_apicid_early_ptr) {
1093 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
1094 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
1095
1096 cpu_to_apicid[cpu] = apicid;
1097 bios_cpu_apicid[cpu] = apicid;
1098 } else {
1099 per_cpu(x86_cpu_to_apicid, cpu) = apicid;
1100 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1101 }
1102
1103 cpu_set(cpu, cpu_possible_map);
1104 cpu_set(cpu, cpu_present_map);
1105}
1106
1060/* 1107/*
1061 * Power management 1108 * Power management
1062 */ 1109 */
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index 49e3bfe01022..d62294003036 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -35,7 +35,6 @@
35 35
36/* Have we found an MP table */ 36/* Have we found an MP table */
37int smp_found_config; 37int smp_found_config;
38unsigned 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
@@ -82,52 +81,6 @@ static int __init mpf_checksum(unsigned char *mp, int len)
82 return sum & 0xFF; 81 return sum & 0xFF;
83} 82}
84 83
85void __cpuinit generic_processor_info(int apicid, int version)
86{
87 int cpu;
88 cpumask_t tmp_map;
89
90 if (num_processors >= NR_CPUS) {
91 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
92 " Processor ignored.\n", NR_CPUS);
93 return;
94 }
95
96 if (num_processors >= maxcpus) {
97 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
98 " Processor ignored.\n", maxcpus);
99 return;
100 }
101
102 num_processors++;
103 cpus_complement(tmp_map, cpu_present_map);
104 cpu = first_cpu(tmp_map);
105
106 physid_set(apicid, phys_cpu_present_map);
107 if (apicid == boot_cpu_physical_apicid) {
108 /*
109 * x86_bios_cpu_apicid is required to have processors listed
110 * in same order as logical cpu numbers. Hence the first
111 * entry is BSP, and so on.
112 */
113 cpu = 0;
114 }
115 /* are we being called early in kernel startup? */
116 if (x86_cpu_to_apicid_early_ptr) {
117 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
118 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
119
120 cpu_to_apicid[cpu] = apicid;
121 bios_cpu_apicid[cpu] = apicid;
122 } else {
123 per_cpu(x86_cpu_to_apicid, cpu) = apicid;
124 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
125 }
126
127 cpu_set(cpu, cpu_possible_map);
128 cpu_set(cpu, cpu_present_map);
129}
130
131static void __cpuinit MP_processor_info(struct mpc_config_processor *m) 84static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
132{ 85{
133 char *bootup_cpu = ""; 86 char *bootup_cpu = "";
@@ -666,7 +619,6 @@ void __init mp_register_lapic_address(u64 address)
666 if (boot_cpu_physical_apicid == -1U) 619 if (boot_cpu_physical_apicid == -1U)
667 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); 620 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
668} 621}
669
670void __cpuinit mp_register_lapic(u8 id, u8 enabled) 622void __cpuinit mp_register_lapic(u8 id, u8 enabled)
671{ 623{
672 if (!enabled) { 624 if (!enabled) {
@@ -677,6 +629,7 @@ void __cpuinit mp_register_lapic(u8 id, u8 enabled)
677 generic_processor_info(id, 0); 629 generic_processor_info(id, 0);
678} 630}
679 631
632
680#define MP_ISA_BUS 0 633#define MP_ISA_BUS 0
681#define MP_MAX_IOAPIC_PIN 127 634#define MP_MAX_IOAPIC_PIN 127
682 635