diff options
-rw-r--r-- | arch/x86/kernel/mpparse_32.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index fd89d3521bd3..838e4974e1ce 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c | |||
@@ -922,31 +922,30 @@ static int mp_find_ioapic (int gsi) | |||
922 | return -1; | 922 | return -1; |
923 | } | 923 | } |
924 | 924 | ||
925 | static u8 uniq_ioapic_id(u8 id) | ||
926 | { | ||
927 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && | ||
928 | !APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) | ||
929 | return io_apic_get_unique_id(nr_ioapics, id); | ||
930 | else | ||
931 | return id; | ||
932 | } | ||
933 | |||
925 | void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) | 934 | void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) |
926 | { | 935 | { |
927 | int idx = 0; | 936 | int idx = 0; |
928 | int tmpid; | ||
929 | 937 | ||
930 | if (bad_ioapic(address)) | 938 | if (bad_ioapic(address)) |
931 | return; | 939 | return; |
932 | 940 | ||
933 | idx = nr_ioapics++; | 941 | idx = nr_ioapics; |
934 | 942 | ||
935 | mp_ioapics[idx].mpc_type = MP_IOAPIC; | 943 | mp_ioapics[idx].mpc_type = MP_IOAPIC; |
936 | mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; | 944 | mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; |
937 | mp_ioapics[idx].mpc_apicaddr = address; | 945 | mp_ioapics[idx].mpc_apicaddr = address; |
938 | 946 | ||
939 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); | 947 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); |
940 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) | 948 | mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id); |
941 | && !APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) | ||
942 | tmpid = io_apic_get_unique_id(idx, id); | ||
943 | else | ||
944 | tmpid = id; | ||
945 | if (tmpid == -1) { | ||
946 | nr_ioapics--; | ||
947 | return; | ||
948 | } | ||
949 | mp_ioapics[idx].mpc_apicid = tmpid; | ||
950 | mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); | 949 | mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); |
951 | 950 | ||
952 | /* | 951 | /* |
@@ -960,9 +959,12 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) | |||
960 | 959 | ||
961 | printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " | 960 | printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " |
962 | "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, | 961 | "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, |
963 | mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr, | 962 | mp_ioapics[idx].mpc_apicver, |
963 | mp_ioapics[idx].mpc_apicaddr, | ||
964 | mp_ioapic_routing[idx].gsi_base, | 964 | mp_ioapic_routing[idx].gsi_base, |
965 | mp_ioapic_routing[idx].gsi_end); | 965 | mp_ioapic_routing[idx].gsi_end); |
966 | |||
967 | nr_ioapics++; | ||
966 | } | 968 | } |
967 | 969 | ||
968 | void __init | 970 | void __init |