aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/mshyperv.c9
-rw-r--r--arch/x86/kernel/i8259.c20
2 files changed, 19 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 76f98fe5b35c..a450373e8e91 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -132,15 +132,6 @@ static void __init ms_hyperv_init_platform(void)
132 lapic_timer_frequency = hv_lapic_frequency; 132 lapic_timer_frequency = hv_lapic_frequency;
133 printk(KERN_INFO "HyperV: LAPIC Timer Frequency: %#x\n", 133 printk(KERN_INFO "HyperV: LAPIC Timer Frequency: %#x\n",
134 lapic_timer_frequency); 134 lapic_timer_frequency);
135
136 /*
137 * On Hyper-V, when we are booting off an EFI firmware stack,
138 * we do not have many legacy devices including PIC, PIT etc.
139 */
140 if (efi_enabled(EFI_BOOT)) {
141 printk(KERN_INFO "HyperV: Using null_legacy_pic\n");
142 legacy_pic = &null_legacy_pic;
143 }
144 } 135 }
145#endif 136#endif
146 137
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 2e977b5d61dd..8af817105e29 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -299,13 +299,31 @@ static void unmask_8259A(void)
299static void init_8259A(int auto_eoi) 299static void init_8259A(int auto_eoi)
300{ 300{
301 unsigned long flags; 301 unsigned long flags;
302 unsigned char probe_val = ~(1 << PIC_CASCADE_IR);
303 unsigned char new_val;
302 304
303 i8259A_auto_eoi = auto_eoi; 305 i8259A_auto_eoi = auto_eoi;
304 306
305 raw_spin_lock_irqsave(&i8259A_lock, flags); 307 raw_spin_lock_irqsave(&i8259A_lock, flags);
306 308
307 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 309 /*
310 * Check to see if we have a PIC.
311 * Mask all except the cascade and read
312 * back the value we just wrote. If we don't
313 * have a PIC, we will read 0xff as opposed to the
314 * value we wrote.
315 */
308 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ 316 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
317 outb(probe_val, PIC_MASTER_IMR);
318 new_val = inb(PIC_MASTER_IMR);
319 if (new_val != probe_val) {
320 printk(KERN_INFO "Using NULL legacy PIC\n");
321 legacy_pic = &null_legacy_pic;
322 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
323 return;
324 }
325
326 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
309 327
310 /* 328 /*
311 * outb_pic - this has to work on a wide range of PC hardware. 329 * outb_pic - this has to work on a wide range of PC hardware.