diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-05-14 11:03:17 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 04:55:13 -0400 |
commit | 2fddb6e28e903a3ab1704cc5aac01be5a59dc05b (patch) | |
tree | 4b24d694fe60ac0be3978b9fb238fe0150328af7 /arch/x86/kernel/io_apic_32.c | |
parent | ec2cd0a22e2715f776a934e01c4f8ea098324fe1 (diff) |
x86: make config_irqsrc not MPspec specific
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/io_apic_32.c')
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index 5af1b717236c..ea68c3e5ba1d 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -76,7 +76,7 @@ struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; | |||
76 | int nr_ioapics; | 76 | int nr_ioapics; |
77 | 77 | ||
78 | /* MP IRQ source entries */ | 78 | /* MP IRQ source entries */ |
79 | struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; | 79 | struct mp_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; |
80 | 80 | ||
81 | /* # of MP IRQ source entries */ | 81 | /* # of MP IRQ source entries */ |
82 | int mp_irq_entries; | 82 | int mp_irq_entries; |
@@ -801,10 +801,10 @@ static int find_irq_entry(int apic, int pin, int type) | |||
801 | int i; | 801 | int i; |
802 | 802 | ||
803 | for (i = 0; i < mp_irq_entries; i++) | 803 | for (i = 0; i < mp_irq_entries; i++) |
804 | if (mp_irqs[i].mpc_irqtype == type && | 804 | if (mp_irqs[i].mp_irqtype == type && |
805 | (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mp_apicid || | 805 | (mp_irqs[i].mp_dstapic == mp_ioapics[apic].mp_apicid || |
806 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && | 806 | mp_irqs[i].mp_dstapic == MP_APIC_ALL) && |
807 | mp_irqs[i].mpc_dstirq == pin) | 807 | mp_irqs[i].mp_dstirq == pin) |
808 | return i; | 808 | return i; |
809 | 809 | ||
810 | return -1; | 810 | return -1; |
@@ -818,13 +818,13 @@ static int __init find_isa_irq_pin(int irq, int type) | |||
818 | int i; | 818 | int i; |
819 | 819 | ||
820 | for (i = 0; i < mp_irq_entries; i++) { | 820 | for (i = 0; i < mp_irq_entries; i++) { |
821 | int lbus = mp_irqs[i].mpc_srcbus; | 821 | int lbus = mp_irqs[i].mp_srcbus; |
822 | 822 | ||
823 | if (test_bit(lbus, mp_bus_not_pci) && | 823 | if (test_bit(lbus, mp_bus_not_pci) && |
824 | (mp_irqs[i].mpc_irqtype == type) && | 824 | (mp_irqs[i].mp_irqtype == type) && |
825 | (mp_irqs[i].mpc_srcbusirq == irq)) | 825 | (mp_irqs[i].mp_srcbusirq == irq)) |
826 | 826 | ||
827 | return mp_irqs[i].mpc_dstirq; | 827 | return mp_irqs[i].mp_dstirq; |
828 | } | 828 | } |
829 | return -1; | 829 | return -1; |
830 | } | 830 | } |
@@ -834,17 +834,17 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
834 | int i; | 834 | int i; |
835 | 835 | ||
836 | for (i = 0; i < mp_irq_entries; i++) { | 836 | for (i = 0; i < mp_irq_entries; i++) { |
837 | int lbus = mp_irqs[i].mpc_srcbus; | 837 | int lbus = mp_irqs[i].mp_srcbus; |
838 | 838 | ||
839 | if (test_bit(lbus, mp_bus_not_pci) && | 839 | if (test_bit(lbus, mp_bus_not_pci) && |
840 | (mp_irqs[i].mpc_irqtype == type) && | 840 | (mp_irqs[i].mp_irqtype == type) && |
841 | (mp_irqs[i].mpc_srcbusirq == irq)) | 841 | (mp_irqs[i].mp_srcbusirq == irq)) |
842 | break; | 842 | break; |
843 | } | 843 | } |
844 | if (i < mp_irq_entries) { | 844 | if (i < mp_irq_entries) { |
845 | int apic; | 845 | int apic; |
846 | for(apic = 0; apic < nr_ioapics; apic++) { | 846 | for(apic = 0; apic < nr_ioapics; apic++) { |
847 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic) | 847 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic) |
848 | return apic; | 848 | return apic; |
849 | } | 849 | } |
850 | } | 850 | } |
@@ -869,23 +869,23 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) | |||
869 | return -1; | 869 | return -1; |
870 | } | 870 | } |
871 | for (i = 0; i < mp_irq_entries; i++) { | 871 | for (i = 0; i < mp_irq_entries; i++) { |
872 | int lbus = mp_irqs[i].mpc_srcbus; | 872 | int lbus = mp_irqs[i].mp_srcbus; |
873 | 873 | ||
874 | for (apic = 0; apic < nr_ioapics; apic++) | 874 | for (apic = 0; apic < nr_ioapics; apic++) |
875 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic || | 875 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic || |
876 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) | 876 | mp_irqs[i].mp_dstapic == MP_APIC_ALL) |
877 | break; | 877 | break; |
878 | 878 | ||
879 | if (!test_bit(lbus, mp_bus_not_pci) && | 879 | if (!test_bit(lbus, mp_bus_not_pci) && |
880 | !mp_irqs[i].mpc_irqtype && | 880 | !mp_irqs[i].mp_irqtype && |
881 | (bus == lbus) && | 881 | (bus == lbus) && |
882 | (slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) { | 882 | (slot == ((mp_irqs[i].mp_srcbusirq >> 2) & 0x1f))) { |
883 | int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq); | 883 | int irq = pin_2_irq(i,apic,mp_irqs[i].mp_dstirq); |
884 | 884 | ||
885 | if (!(apic || IO_APIC_IRQ(irq))) | 885 | if (!(apic || IO_APIC_IRQ(irq))) |
886 | continue; | 886 | continue; |
887 | 887 | ||
888 | if (pin == (mp_irqs[i].mpc_srcbusirq & 3)) | 888 | if (pin == (mp_irqs[i].mp_srcbusirq & 3)) |
889 | return irq; | 889 | return irq; |
890 | /* | 890 | /* |
891 | * Use the first all-but-pin matching entry as a | 891 | * Use the first all-but-pin matching entry as a |
@@ -952,7 +952,7 @@ static int EISA_ELCR(unsigned int irq) | |||
952 | * EISA conforming in the MP table, that means its trigger type must | 952 | * EISA conforming in the MP table, that means its trigger type must |
953 | * be read in from the ELCR */ | 953 | * be read in from the ELCR */ |
954 | 954 | ||
955 | #define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mpc_srcbusirq)) | 955 | #define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mp_srcbusirq)) |
956 | #define default_EISA_polarity(idx) default_ISA_polarity(idx) | 956 | #define default_EISA_polarity(idx) default_ISA_polarity(idx) |
957 | 957 | ||
958 | /* PCI interrupts are always polarity one level triggered, | 958 | /* PCI interrupts are always polarity one level triggered, |
@@ -969,13 +969,13 @@ static int EISA_ELCR(unsigned int irq) | |||
969 | 969 | ||
970 | static int MPBIOS_polarity(int idx) | 970 | static int MPBIOS_polarity(int idx) |
971 | { | 971 | { |
972 | int bus = mp_irqs[idx].mpc_srcbus; | 972 | int bus = mp_irqs[idx].mp_srcbus; |
973 | int polarity; | 973 | int polarity; |
974 | 974 | ||
975 | /* | 975 | /* |
976 | * Determine IRQ line polarity (high active or low active): | 976 | * Determine IRQ line polarity (high active or low active): |
977 | */ | 977 | */ |
978 | switch (mp_irqs[idx].mpc_irqflag & 3) | 978 | switch (mp_irqs[idx].mp_irqflag & 3) |
979 | { | 979 | { |
980 | case 0: /* conforms, ie. bus-type dependent polarity */ | 980 | case 0: /* conforms, ie. bus-type dependent polarity */ |
981 | { | 981 | { |
@@ -1012,13 +1012,13 @@ static int MPBIOS_polarity(int idx) | |||
1012 | 1012 | ||
1013 | static int MPBIOS_trigger(int idx) | 1013 | static int MPBIOS_trigger(int idx) |
1014 | { | 1014 | { |
1015 | int bus = mp_irqs[idx].mpc_srcbus; | 1015 | int bus = mp_irqs[idx].mp_srcbus; |
1016 | int trigger; | 1016 | int trigger; |
1017 | 1017 | ||
1018 | /* | 1018 | /* |
1019 | * Determine IRQ trigger mode (edge or level sensitive): | 1019 | * Determine IRQ trigger mode (edge or level sensitive): |
1020 | */ | 1020 | */ |
1021 | switch ((mp_irqs[idx].mpc_irqflag>>2) & 3) | 1021 | switch ((mp_irqs[idx].mp_irqflag>>2) & 3) |
1022 | { | 1022 | { |
1023 | case 0: /* conforms, ie. bus-type dependent */ | 1023 | case 0: /* conforms, ie. bus-type dependent */ |
1024 | { | 1024 | { |
@@ -1097,16 +1097,16 @@ static inline int irq_trigger(int idx) | |||
1097 | static int pin_2_irq(int idx, int apic, int pin) | 1097 | static int pin_2_irq(int idx, int apic, int pin) |
1098 | { | 1098 | { |
1099 | int irq, i; | 1099 | int irq, i; |
1100 | int bus = mp_irqs[idx].mpc_srcbus; | 1100 | int bus = mp_irqs[idx].mp_srcbus; |
1101 | 1101 | ||
1102 | /* | 1102 | /* |
1103 | * Debugging check, we are in big trouble if this message pops up! | 1103 | * Debugging check, we are in big trouble if this message pops up! |
1104 | */ | 1104 | */ |
1105 | if (mp_irqs[idx].mpc_dstirq != pin) | 1105 | if (mp_irqs[idx].mp_dstirq != pin) |
1106 | printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); | 1106 | printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); |
1107 | 1107 | ||
1108 | if (test_bit(bus, mp_bus_not_pci)) | 1108 | if (test_bit(bus, mp_bus_not_pci)) |
1109 | irq = mp_irqs[idx].mpc_srcbusirq; | 1109 | irq = mp_irqs[idx].mp_srcbusirq; |
1110 | else { | 1110 | else { |
1111 | /* | 1111 | /* |
1112 | * PCI IRQs are mapped in order | 1112 | * PCI IRQs are mapped in order |
@@ -1793,8 +1793,8 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1793 | */ | 1793 | */ |
1794 | if (old_id != mp_ioapics[apic].mp_apicid) | 1794 | if (old_id != mp_ioapics[apic].mp_apicid) |
1795 | for (i = 0; i < mp_irq_entries; i++) | 1795 | for (i = 0; i < mp_irq_entries; i++) |
1796 | if (mp_irqs[i].mpc_dstapic == old_id) | 1796 | if (mp_irqs[i].mp_dstapic == old_id) |
1797 | mp_irqs[i].mpc_dstapic | 1797 | mp_irqs[i].mp_dstapic |
1798 | = mp_ioapics[apic].mp_apicid; | 1798 | = mp_ioapics[apic].mp_apicid; |
1799 | 1799 | ||
1800 | /* | 1800 | /* |
@@ -2810,8 +2810,8 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) | |||
2810 | return -1; | 2810 | return -1; |
2811 | 2811 | ||
2812 | for (i = 0; i < mp_irq_entries; i++) | 2812 | for (i = 0; i < mp_irq_entries; i++) |
2813 | if (mp_irqs[i].mpc_irqtype == mp_INT && | 2813 | if (mp_irqs[i].mp_irqtype == mp_INT && |
2814 | mp_irqs[i].mpc_srcbusirq == bus_irq) | 2814 | mp_irqs[i].mp_srcbusirq == bus_irq) |
2815 | break; | 2815 | break; |
2816 | if (i >= mp_irq_entries) | 2816 | if (i >= mp_irq_entries) |
2817 | return -1; | 2817 | return -1; |