diff options
author | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
commit | 7022b15e2a9f878fd5184586064c63352c3dd225 (patch) | |
tree | 5365c2f5bc82ae1946636ee8d5cd5d3b7e804f1b /arch/x86/kernel/mpparse.c | |
parent | aaad2b0c757f3e6e02552cb0bdcd91a5ec0d6305 (diff) | |
parent | a15306365a16380f3bafee9e181ba01231d4acd7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/x86/kernel/mpparse.c')
-rw-r--r-- | arch/x86/kernel/mpparse.c | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 70744e344fa1..404683b94e79 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -686,13 +686,11 @@ void __init get_smp_config(void) | |||
686 | static int __init smp_scan_config(unsigned long base, unsigned long length, | 686 | static int __init smp_scan_config(unsigned long base, unsigned long length, |
687 | unsigned reserve) | 687 | unsigned reserve) |
688 | { | 688 | { |
689 | extern void __bad_mpf_size(void); | ||
690 | unsigned int *bp = phys_to_virt(base); | 689 | unsigned int *bp = phys_to_virt(base); |
691 | struct intel_mp_floating *mpf; | 690 | struct intel_mp_floating *mpf; |
692 | 691 | ||
693 | Dprintk("Scan SMP from %p for %ld bytes.\n", bp, length); | 692 | Dprintk("Scan SMP from %p for %ld bytes.\n", bp, length); |
694 | if (sizeof(*mpf) != 16) | 693 | BUILD_BUG_ON(sizeof(*mpf) != 16); |
695 | __bad_mpf_size(); | ||
696 | 694 | ||
697 | while (length > 0) { | 695 | while (length > 0) { |
698 | mpf = (struct intel_mp_floating *)bp; | 696 | mpf = (struct intel_mp_floating *)bp; |
@@ -796,12 +794,16 @@ void __init find_smp_config(void) | |||
796 | ACPI-based MP Configuration | 794 | ACPI-based MP Configuration |
797 | -------------------------------------------------------------------------- */ | 795 | -------------------------------------------------------------------------- */ |
798 | 796 | ||
797 | /* | ||
798 | * Keep this outside and initialized to 0, for !CONFIG_ACPI builds: | ||
799 | */ | ||
800 | int es7000_plat; | ||
801 | |||
799 | #ifdef CONFIG_ACPI | 802 | #ifdef CONFIG_ACPI |
800 | 803 | ||
801 | #ifdef CONFIG_X86_IO_APIC | 804 | #ifdef CONFIG_X86_IO_APIC |
802 | 805 | ||
803 | #define MP_ISA_BUS 0 | 806 | #define MP_ISA_BUS 0 |
804 | #define MP_MAX_IOAPIC_PIN 127 | ||
805 | 807 | ||
806 | extern struct mp_ioapic_routing mp_ioapic_routing[MAX_IO_APICS]; | 808 | extern struct mp_ioapic_routing mp_ioapic_routing[MAX_IO_APICS]; |
807 | 809 | ||
@@ -820,7 +822,7 @@ static int mp_find_ioapic(int gsi) | |||
820 | return -1; | 822 | return -1; |
821 | } | 823 | } |
822 | 824 | ||
823 | static u8 uniq_ioapic_id(u8 id) | 825 | static u8 __init uniq_ioapic_id(u8 id) |
824 | { | 826 | { |
825 | #ifdef CONFIG_X86_32 | 827 | #ifdef CONFIG_X86_32 |
826 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && | 828 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && |
@@ -909,18 +911,9 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) | |||
909 | intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ | 911 | intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ |
910 | intsrc.mpc_dstirq = pin; /* INTIN# */ | 912 | intsrc.mpc_dstirq = pin; /* INTIN# */ |
911 | 913 | ||
912 | Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n", | 914 | MP_intsrc_info(&intsrc); |
913 | intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, | ||
914 | (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, | ||
915 | intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); | ||
916 | |||
917 | mp_irqs[mp_irq_entries] = intsrc; | ||
918 | if (++mp_irq_entries == MAX_IRQ_SOURCES) | ||
919 | panic("Max # of irq sources exceeded!\n"); | ||
920 | } | 915 | } |
921 | 916 | ||
922 | int es7000_plat; | ||
923 | |||
924 | void __init mp_config_acpi_legacy_irqs(void) | 917 | void __init mp_config_acpi_legacy_irqs(void) |
925 | { | 918 | { |
926 | struct mpc_config_intsrc intsrc; | 919 | struct mpc_config_intsrc intsrc; |
@@ -985,23 +978,14 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
985 | intsrc.mpc_srcbusirq = i; /* Identity mapped */ | 978 | intsrc.mpc_srcbusirq = i; /* Identity mapped */ |
986 | intsrc.mpc_dstirq = i; | 979 | intsrc.mpc_dstirq = i; |
987 | 980 | ||
988 | Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, " | 981 | MP_intsrc_info(&intsrc); |
989 | "%d-%d\n", intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, | ||
990 | (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, | ||
991 | intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, | ||
992 | intsrc.mpc_dstirq); | ||
993 | |||
994 | mp_irqs[mp_irq_entries] = intsrc; | ||
995 | if (++mp_irq_entries == MAX_IRQ_SOURCES) | ||
996 | panic("Max # of irq sources exceeded!\n"); | ||
997 | } | 982 | } |
998 | } | 983 | } |
999 | 984 | ||
1000 | int mp_register_gsi(u32 gsi, int triggering, int polarity) | 985 | int mp_register_gsi(u32 gsi, int triggering, int polarity) |
1001 | { | 986 | { |
1002 | int ioapic = -1; | 987 | int ioapic; |
1003 | int ioapic_pin = 0; | 988 | int ioapic_pin; |
1004 | int idx, bit = 0; | ||
1005 | #ifdef CONFIG_X86_32 | 989 | #ifdef CONFIG_X86_32 |
1006 | #define MAX_GSI_NUM 4096 | 990 | #define MAX_GSI_NUM 4096 |
1007 | #define IRQ_COMPRESSION_START 64 | 991 | #define IRQ_COMPRESSION_START 64 |
@@ -1041,15 +1025,13 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
1041 | * with redundant pin->gsi mappings (but unique PCI devices); | 1025 | * with redundant pin->gsi mappings (but unique PCI devices); |
1042 | * we only program the IOAPIC on the first. | 1026 | * we only program the IOAPIC on the first. |
1043 | */ | 1027 | */ |
1044 | bit = ioapic_pin % 32; | 1028 | if (ioapic_pin > MP_MAX_IOAPIC_PIN) { |
1045 | idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); | ||
1046 | if (idx > 3) { | ||
1047 | printk(KERN_ERR "Invalid reference to IOAPIC pin " | 1029 | printk(KERN_ERR "Invalid reference to IOAPIC pin " |
1048 | "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, | 1030 | "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, |
1049 | ioapic_pin); | 1031 | ioapic_pin); |
1050 | return gsi; | 1032 | return gsi; |
1051 | } | 1033 | } |
1052 | if ((1 << bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) { | 1034 | if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) { |
1053 | Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n", | 1035 | Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n", |
1054 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); | 1036 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); |
1055 | #ifdef CONFIG_X86_32 | 1037 | #ifdef CONFIG_X86_32 |
@@ -1059,7 +1041,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
1059 | #endif | 1041 | #endif |
1060 | } | 1042 | } |
1061 | 1043 | ||
1062 | mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1 << bit); | 1044 | set_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed); |
1063 | #ifdef CONFIG_X86_32 | 1045 | #ifdef CONFIG_X86_32 |
1064 | /* | 1046 | /* |
1065 | * For GSI >= 64, use IRQ compression | 1047 | * For GSI >= 64, use IRQ compression |