aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/acpi
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-11-18 22:33:35 -0500
committerThomas Gleixner <tglx@linutronix.de>2010-12-09 15:52:06 -0500
commit2d8009ba67f9503ceadf9d5a3b5637cee291ea8d (patch)
treeab3ca6aacc84b5fb0135909e788c5b65830cd75f /arch/x86/kernel/acpi
parent60d79fd99ff3b9c692b260a4d53a203f537c052a (diff)
x86: Unify 3 similar ways of saving mp_irqs info
There are 3 places defining similar functions of saving IRQ vector info into mp_irqs[] array: mmparse/acpi/mrst. Replace the redundant code by a common function in io_apic.c as it's only called when CONFIG_X86_IO_APIC=y Signed-off-by: Feng Tang <feng.tang@intel.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Len Brown <len.brown@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <20101207133204.4d913c5a@feng-i7> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r--arch/x86/kernel/acpi/boot.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index b3cf01ab0630..1a5b9a8e6c4f 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -937,32 +937,6 @@ static int __init acpi_parse_madt_lapic_entries(void)
937extern int es7000_plat; 937extern int es7000_plat;
938#endif 938#endif
939 939
940static void assign_to_mp_irq(struct mpc_intsrc *m,
941 struct mpc_intsrc *mp_irq)
942{
943 memcpy(mp_irq, m, sizeof(struct mpc_intsrc));
944}
945
946static int mp_irq_cmp(struct mpc_intsrc *mp_irq,
947 struct mpc_intsrc *m)
948{
949 return memcmp(mp_irq, m, sizeof(struct mpc_intsrc));
950}
951
952static void save_mp_irq(struct mpc_intsrc *m)
953{
954 int i;
955
956 for (i = 0; i < mp_irq_entries; i++) {
957 if (!mp_irq_cmp(&mp_irqs[i], m))
958 return;
959 }
960
961 assign_to_mp_irq(m, &mp_irqs[mp_irq_entries]);
962 if (++mp_irq_entries == MAX_IRQ_SOURCES)
963 panic("Max # of irq sources exceeded!!\n");
964}
965
966void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) 940void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
967{ 941{
968 int ioapic; 942 int ioapic;
@@ -993,7 +967,7 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
993 mp_irq.dstapic = mp_ioapics[ioapic].apicid; /* APIC ID */ 967 mp_irq.dstapic = mp_ioapics[ioapic].apicid; /* APIC ID */
994 mp_irq.dstirq = pin; /* INTIN# */ 968 mp_irq.dstirq = pin; /* INTIN# */
995 969
996 save_mp_irq(&mp_irq); 970 mp_save_irq(&mp_irq);
997 971
998 isa_irq_to_gsi[bus_irq] = gsi; 972 isa_irq_to_gsi[bus_irq] = gsi;
999} 973}
@@ -1068,7 +1042,7 @@ void __init mp_config_acpi_legacy_irqs(void)
1068 mp_irq.srcbusirq = i; /* Identity mapped */ 1042 mp_irq.srcbusirq = i; /* Identity mapped */
1069 mp_irq.dstirq = pin; 1043 mp_irq.dstirq = pin;
1070 1044
1071 save_mp_irq(&mp_irq); 1045 mp_save_irq(&mp_irq);
1072 } 1046 }
1073} 1047}
1074 1048
@@ -1105,7 +1079,7 @@ static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger,
1105 mp_irq.dstapic = mp_ioapics[ioapic].apicid; 1079 mp_irq.dstapic = mp_ioapics[ioapic].apicid;
1106 mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi); 1080 mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);
1107 1081
1108 save_mp_irq(&mp_irq); 1082 mp_save_irq(&mp_irq);
1109#endif 1083#endif
1110 return 0; 1084 return 0;
1111} 1085}