diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-04-04 15:42:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:36 -0400 |
commit | 22cbb4bd12a86b80125accb77515482894ee670f (patch) | |
tree | 0a12dbb766272c5b0fc27f915e07c5c96887b75f /arch/x86/kernel/mpparse_32.c | |
parent | 92fd4b7abdb2b5b85d73ca0adbb6ad3f8b79f805 (diff) |
x86: unify uniq_io_apic_id
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.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index 7feafa5040d8..a50a31331f97 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c | |||
@@ -814,17 +814,29 @@ static int mp_find_ioapic(int gsi) | |||
814 | } | 814 | } |
815 | 815 | ||
816 | printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi); | 816 | printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi); |
817 | |||
818 | return -1; | 817 | return -1; |
819 | } | 818 | } |
820 | 819 | ||
821 | static u8 uniq_ioapic_id(u8 id) | 820 | static u8 uniq_ioapic_id(u8 id) |
822 | { | 821 | { |
822 | #ifdef CONFIG_X86_32 | ||
823 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && | 823 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && |
824 | !APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) | 824 | !APIC_XAPIC(apic_version[boot_cpu_physical_apicid])) |
825 | return io_apic_get_unique_id(nr_ioapics, id); | 825 | return io_apic_get_unique_id(nr_ioapics, id); |
826 | else | 826 | else |
827 | return id; | 827 | return id; |
828 | #else | ||
829 | int i; | ||
830 | DECLARE_BITMAP(used, 256); | ||
831 | bitmap_zero(used, 256); | ||
832 | for (i = 0; i < nr_ioapics; i++) { | ||
833 | struct mpc_config_ioapic *ia = &mp_ioapics[i]; | ||
834 | __set_bit(ia->mpc_apicid, used); | ||
835 | } | ||
836 | if (!test_bit(id, used)) | ||
837 | return id; | ||
838 | return find_first_zero_bit(used, 256); | ||
839 | #endif | ||
828 | } | 840 | } |
829 | 841 | ||
830 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | 842 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) |