summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mpparse_32.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy2008-03-17 20:08:05 +0100
committerIngo Molnar2008-04-17 17:41:04 +0200
commit857033a696996beb1cdc0d5ee5cfcfa91c8bbece (patch)
tree0f5504d303f98163f762d3849da1ad4eec5dc07c /arch/x86/kernel/mpparse_32.c
parentx86: lindent mpparse_64.c (diff)
downloadkernel-qcow2-linux-857033a696996beb1cdc0d5ee5cfcfa91c8bbece.tar.gz
kernel-qcow2-linux-857033a696996beb1cdc0d5ee5cfcfa91c8bbece.tar.xz
kernel-qcow2-linux-857033a696996beb1cdc0d5ee5cfcfa91c8bbece.zip
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)
}
}
+static int bad_ioapic(unsigned long address)
+{
+ if (nr_ioapics >= MAX_IO_APICS) {
+ printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
+ "(found %d)\n", MAX_IO_APICS, nr_ioapics);
+ panic("Recompile kernel with bigger MAX_IO_APICS!\n");
+ }
+ if (!address) {
+ printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
+ " found in table, skipping!\n");
+ return 1;
+ }
+ return 0;
+}
+
static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
{
if (!(m->mpc_flags & MPC_APIC_USABLE))
@@ -294,16 +309,10 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr);
- if (nr_ioapics >= MAX_IO_APICS) {
- printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n",
- MAX_IO_APICS, nr_ioapics);
- panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
- }
- if (!m->mpc_apicaddr) {
- printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
- " found in MP table, skipping!\n");
+
+ if (bad_ioapic(m->mpc_apicaddr))
return;
- }
+
mp_ioapics[nr_ioapics] = *m;
nr_ioapics++;
}
@@ -918,16 +927,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
int idx = 0;
int tmpid;
- if (nr_ioapics >= MAX_IO_APICS) {
- printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
- "(found %d)\n", MAX_IO_APICS, nr_ioapics);
- panic("Recompile kernel with bigger MAX_IO_APICS!\n");
- }
- if (!address) {
- printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
- " found in MADT table, skipping!\n");
+ if (bad_ioapic(address))
return;
- }
idx = nr_ioapics++;