diff options
Diffstat (limited to 'arch/x86_64/kernel/io_apic.c')
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index afd87e64d0a8..157190d986bb 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 | */ |
333 | static int __init find_isa_irq_pin(int irq, int type) | 333 | static int find_isa_irq_pin(int irq, int type) |
334 | { | 334 | { |
335 | int i; | 335 | int i; |
336 | 336 | ||
@@ -1132,12 +1132,44 @@ static void __init enable_IO_APIC(void) | |||
1132 | */ | 1132 | */ |
1133 | void disable_IO_APIC(void) | 1133 | void disable_IO_APIC(void) |
1134 | { | 1134 | { |
1135 | int pin; | ||
1135 | /* | 1136 | /* |
1136 | * Clear the IO-APIC before rebooting: | 1137 | * Clear the IO-APIC before rebooting: |
1137 | */ | 1138 | */ |
1138 | clear_IO_APIC(); | 1139 | clear_IO_APIC(); |
1139 | 1140 | ||
1140 | disconnect_bsp_APIC(); | 1141 | /* |
1142 | * If the i82559 is routed through an IOAPIC | ||
1143 | * Put that IOAPIC in virtual wire mode | ||
1144 | * so legacy interrups can be delivered. | ||
1145 | */ | ||
1146 | pin = find_isa_irq_pin(0, mp_ExtINT); | ||
1147 | if (pin != -1) { | ||
1148 | struct IO_APIC_route_entry entry; | ||
1149 | unsigned long flags; | ||
1150 | |||
1151 | memset(&entry, 0, sizeof(entry)); | ||
1152 | entry.mask = 0; /* Enabled */ | ||
1153 | entry.trigger = 0; /* Edge */ | ||
1154 | entry.irr = 0; | ||
1155 | entry.polarity = 0; /* High */ | ||
1156 | entry.delivery_status = 0; | ||
1157 | entry.dest_mode = 0; /* Physical */ | ||
1158 | entry.delivery_mode = 7; /* ExtInt */ | ||
1159 | entry.vector = 0; | ||
1160 | entry.dest.physical.physical_dest = 0; | ||
1161 | |||
1162 | |||
1163 | /* | ||
1164 | * Add it to the IO-APIC irq-routing table: | ||
1165 | */ | ||
1166 | spin_lock_irqsave(&ioapic_lock, flags); | ||
1167 | io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1)); | ||
1168 | io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0)); | ||
1169 | spin_unlock_irqrestore(&ioapic_lock, flags); | ||
1170 | } | ||
1171 | |||
1172 | disconnect_bsp_APIC(pin != -1); | ||
1141 | } | 1173 | } |
1142 | 1174 | ||
1143 | /* | 1175 | /* |