mach_reboot.h 710 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * arch/i386/mach-generic/mach_reboot.h
  3. *
  4. * Machine specific reboot functions for generic.
  5. * Split out from reboot.c by Osamu Tomita <tomita@cinet.co.jp>
  6. */
  7. #ifndef _MACH_REBOOT_H
  8. #define _MACH_REBOOT_H
  9. static inline void kb_wait(void)
  10. {
  11. int i;
  12. for (i = 0; i < 0x10000; i++)
  13. if ((inb_p(0x64) & 0x02) == 0)
  14. break;
  15. }
  16. static inline void mach_reboot(void)
  17. {
  18. int i;
  19. for (i = 0; i < 10; i++) {
  20. kb_wait();
  21. udelay(50);
  22. outb(0x60, 0x64); /* write Controller Command Byte */
  23. udelay(50);
  24. kb_wait();
  25. udelay(50);
  26. outb(0x14, 0x60); /* set "System flag" */
  27. udelay(50);
  28. kb_wait();
  29. udelay(50);
  30. outb(0xfe, 0x64); /* pulse reset low */
  31. udelay(50);
  32. }
  33. }
  34. #endif /* !_MACH_REBOOT_H */