ResetSystemLib.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** @file
  2. Reset System Library functions for PCAT platforms
  3. Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include <Base.h>
  7. #include <Library/DebugLib.h>
  8. #include <Library/IoLib.h>
  9. /**
  10. Calling this function causes a system-wide reset. This sets
  11. all circuitry within the system to its initial state. This type of reset
  12. is asynchronous to system operation and operates without regard to
  13. cycle boundaries.
  14. System reset should not return, if it returns, it means the system does
  15. not support cold reset.
  16. **/
  17. VOID
  18. EFIAPI
  19. ResetCold (
  20. VOID
  21. )
  22. {
  23. IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
  24. }
  25. /**
  26. Calling this function causes a system-wide initialization. The processors
  27. are set to their initial state, and pending cycles are not corrupted.
  28. System reset should not return, if it returns, it means the system does
  29. not support warm reset.
  30. **/
  31. VOID
  32. EFIAPI
  33. ResetWarm (
  34. VOID
  35. )
  36. {
  37. IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
  38. }
  39. /**
  40. Calling this function causes the system to enter a power state equivalent
  41. to the ACPI G2/S5 or G3 states.
  42. System shutdown should not return, if it returns, it means the system does
  43. not support shut down reset.
  44. **/
  45. VOID
  46. EFIAPI
  47. ResetShutdown (
  48. VOID
  49. )
  50. {
  51. ASSERT (FALSE);
  52. }
  53. /**
  54. Calling this function causes the system to enter a power state for capsule
  55. update.
  56. Reset update should not return, if it returns, it means the system does
  57. not support capsule update.
  58. **/
  59. VOID
  60. EFIAPI
  61. EnterS3WithImmediateWake (
  62. VOID
  63. )
  64. {
  65. ASSERT (FALSE);
  66. }
  67. /**
  68. This function causes a systemwide reset. The exact type of the reset is
  69. defined by the EFI_GUID that follows the Null-terminated Unicode string passed
  70. into ResetData. If the platform does not recognize the EFI_GUID in ResetData
  71. the platform must pick a supported reset type to perform.The platform may
  72. optionally log the parameters from any non-normal reset that occurs.
  73. @param[in] DataSize The size, in bytes, of ResetData.
  74. @param[in] ResetData The data buffer starts with a Null-terminated string,
  75. followed by the EFI_GUID.
  76. **/
  77. VOID
  78. EFIAPI
  79. ResetPlatformSpecific (
  80. IN UINTN DataSize,
  81. IN VOID *ResetData
  82. )
  83. {
  84. ResetCold ();
  85. }