Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. ixreboot.c
  5. Abstract:
  6. Provides the interface to the firmware for x86. Since there is no
  7. firmware to speak of on x86, this is just reboot support.
  8. Author:
  9. John Vert (jvert) 12-Aug-1991
  10. Revision History:
  11. --*/
  12. #include "halp.h"
  13. //
  14. // Defines to let us diddle the CMOS clock and the keyboard
  15. //
  16. #define CMOS_CTRL (PUCHAR )0x70
  17. #define CMOS_DATA (PUCHAR )0x71
  18. #define RESET 0xfe
  19. #define KEYBPORT (PUCHAR )0x64
  20. //
  21. // Private function prototypes
  22. //
  23. VOID
  24. HalpReboot (
  25. VOID
  26. );
  27. VOID
  28. HalpReboot (
  29. VOID
  30. )
  31. /*++
  32. Routine Description:
  33. This procedure resets the CMOS clock to the standard timer settings
  34. so the bios will work, and then issues a reset command to the keyboard
  35. to cause a warm boot.
  36. It is very machine dependent, this implementation is intended for
  37. PC-AT like machines.
  38. This code copied from the "old debugger" sources.
  39. N.B.
  40. Will NOT return.
  41. --*/
  42. {
  43. UCHAR Scratch;
  44. PUSHORT Magic;
  45. EFI_STATUS status;
  46. //
  47. // Disable IA64 Errror Handling
  48. //
  49. HalpMCADisable();
  50. //
  51. // Instead of the previous code we will use Efi's reset proc (RESET_TYPE = cold boot).
  52. //
  53. status = HalpCallEfi (
  54. EFI_RESET_SYSTEM_INDEX,
  55. (ULONGLONG)EfiResetCold,
  56. EFI_SUCCESS,
  57. 0,
  58. 0,
  59. 0,
  60. 0,
  61. 0,
  62. 0
  63. );
  64. HalDebugPrint(( HAL_INFO, "HAL: HalpReboot - returned from HalpCallEfi: %I64X\n", status ));
  65. //
  66. // If we return, send the reset command to the keyboard controller
  67. //
  68. WRITE_PORT_UCHAR(KEYBPORT, RESET);
  69. }