aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mpparse_32.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-03-17 15:08:05 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:04 -0400
commit857033a696996beb1cdc0d5ee5cfcfa91c8bbece (patch)
tree0f5504d303f98163f762d3849da1ad4eec5dc07c /arch/x86/kernel/mpparse_32.c
parentd2953315c70a4783c94ae6af04f4b0aaad2f09c5 (diff)
x86: add bad_ioapic to mpparse_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/mpparse_32.c')
-rw-r--r--arch/x86/kernel/mpparse_32.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c
index 000b51b78fbd..fd89d3521bd3 100644
--- a/arch/x86/kernel/mpparse_32.c
+++ b/arch/x86/kernel/mpparse_32.c
@@ -287,6 +287,21 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
287 } 287 }
288} 288}
289 289
290static int bad_ioapic(unsigned long address)
291{
292 if (nr_ioapics >= MAX_IO_APICS) {
293 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
294 "(found %d)\n", MAX_IO_APICS, nr_ioapics);
295 panic("Recompile kernel with bigger MAX_IO_APICS!\n");
296 }
297 if (!address) {
298 printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
299 " found in table, skipping!\n");
300 return 1;
301 }
302 return 0;
303}
304
290static void __init MP_ioapic_info (struct mpc_config_ioapic *m) 305static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
291{ 306{
292 if (!(m->mpc_flags & MPC_APIC_USABLE)) 307 if (!(m->mpc_flags & MPC_APIC_USABLE))
@@ -294,16 +309,10 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
294 309
295 printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n", 310 printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
296 m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr); 311 m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr);
297 if (nr_ioapics >= MAX_IO_APICS) { 312
298 printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n", 313 if (bad_ioapic(m->mpc_apicaddr))
299 MAX_IO_APICS, nr_ioapics);
300 panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
301 }
302 if (!m->mpc_apicaddr) {
303 printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
304 " found in MP table, skipping!\n");
305 return; 314 return;
306 } 315
307 mp_ioapics[nr_ioapics] = *m; 316 mp_ioapics[nr_ioapics] = *m;
308 nr_ioapics++; 317 nr_ioapics++;
309} 318}
@@ -918,16 +927,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
918 int idx = 0; 927 int idx = 0;
919 int tmpid; 928 int tmpid;
920 929
921 if (nr_ioapics >= MAX_IO_APICS) { 930 if (bad_ioapic(address))
922 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
923 "(found %d)\n", MAX_IO_APICS, nr_ioapics);
924 panic("Recompile kernel with bigger MAX_IO_APICS!\n");
925 }
926 if (!address) {
927 printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
928 " found in MADT table, skipping!\n");
929 return; 931 return;
930 }
931 932
932 idx = nr_ioapics++; 933 idx = nr_ioapics++;
933 934