aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/io_apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/io_apic.c')
-rw-r--r--arch/x86_64/kernel/io_apic.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index afd87e64d0a8..d206d7e49cf5 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -330,7 +330,7 @@ static int find_irq_entry(int apic, int pin, int type)
330/* 330/*
331 * Find the pin to which IRQ[irq] (ISA) is connected 331 * Find the pin to which IRQ[irq] (ISA) is connected
332 */ 332 */
333static int __init find_isa_irq_pin(int irq, int type) 333static int find_isa_irq_pin(int irq, int type)
334{ 334{
335 int i; 335 int i;
336 336
@@ -1064,7 +1064,6 @@ void print_all_local_APICs (void)
1064 1064
1065void __apicdebuginit print_PIC(void) 1065void __apicdebuginit print_PIC(void)
1066{ 1066{
1067 extern spinlock_t i8259A_lock;
1068 unsigned int v; 1067 unsigned int v;
1069 unsigned long flags; 1068 unsigned long flags;
1070 1069
@@ -1132,12 +1131,44 @@ static void __init enable_IO_APIC(void)
1132 */ 1131 */
1133void disable_IO_APIC(void) 1132void disable_IO_APIC(void)
1134{ 1133{
1134 int pin;
1135 /* 1135 /*
1136 * Clear the IO-APIC before rebooting: 1136 * Clear the IO-APIC before rebooting:
1137 */ 1137 */
1138 clear_IO_APIC(); 1138 clear_IO_APIC();
1139 1139
1140 disconnect_bsp_APIC(); 1140 /*
1141 * If the i82559 is routed through an IOAPIC
1142 * Put that IOAPIC in virtual wire mode
1143 * so legacy interrups can be delivered.
1144 */
1145 pin = find_isa_irq_pin(0, mp_ExtINT);
1146 if (pin != -1) {
1147 struct IO_APIC_route_entry entry;
1148 unsigned long flags;
1149
1150 memset(&entry, 0, sizeof(entry));
1151 entry.mask = 0; /* Enabled */
1152 entry.trigger = 0; /* Edge */
1153 entry.irr = 0;
1154 entry.polarity = 0; /* High */
1155 entry.delivery_status = 0;
1156 entry.dest_mode = 0; /* Physical */
1157 entry.delivery_mode = 7; /* ExtInt */
1158 entry.vector = 0;
1159 entry.dest.physical.physical_dest = 0;
1160
1161
1162 /*
1163 * Add it to the IO-APIC irq-routing table:
1164 */
1165 spin_lock_irqsave(&ioapic_lock, flags);
1166 io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1));
1167 io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0));
1168 spin_unlock_irqrestore(&ioapic_lock, flags);
1169 }
1170
1171 disconnect_bsp_APIC(pin != -1);
1141} 1172}
1142 1173
1143/* 1174/*