x86: Make reboot more robust
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 11 Feb 2014 22:47:03 +0000 (14:47 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 11 Feb 2014 22:47:03 +0000 (14:47 -0800)
PCI reset method.

kern/arch/x86/arch.h

index 5816c5d..89f35c4 100644 (file)
@@ -203,7 +203,10 @@ static inline void cache_flush(void)
 
 static inline void reboot(void)
 {
+       uint8_t cf9 = inb(0xcf9) & ~6;
        outb(0x92, 0x3);
+       outb(0xcf9, cf9 | 2);
+       outb(0xcf9, cf9 | 6);
        asm volatile ("mov $0, %"X86_REG_SP"; int $0");
        while (1);
 }