\r
**/\r
\r
-#include <Base.h>\r
+#include <Base.h> // BIT1\r
\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/PciLib.h>\r
-#include <Library/TimerLib.h>\r
-#include <OvmfPlatforms.h>\r
-\r
-VOID\r
-AcpiPmControl (\r
- UINTN SuspendType\r
- )\r
-{\r
- UINT16 AcpiPmBaseAddress;\r
- UINT16 HostBridgeDevId;\r
-\r
- ASSERT (SuspendType < 6);\r
-\r
- AcpiPmBaseAddress = 0;\r
- HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);\r
- switch (HostBridgeDevId) {\r
- case INTEL_82441_DEVICE_ID:\r
- AcpiPmBaseAddress = PIIX4_PMBA_VALUE;\r
- break;\r
- case INTEL_Q35_MCH_DEVICE_ID:\r
- AcpiPmBaseAddress = ICH9_PMBASE_VALUE;\r
- break;\r
- default:\r
- ASSERT (FALSE);\r
- CpuDeadLoop ();\r
- }\r
-\r
- IoBitFieldWrite16 (AcpiPmBaseAddress + 4, 10, 13, (UINT16) SuspendType);\r
- IoOr16 (AcpiPmBaseAddress + 4, BIT13);\r
- CpuDeadLoop ();\r
-}\r
+#include <Library/BaseLib.h> // CpuDeadLoop()\r
+#include <Library/IoLib.h> // IoWrite8()\r
+#include <Library/ResetSystemLib.h> // ResetCold()\r
+#include <Library/TimerLib.h> // MicroSecondDelay()\r
\r
/**\r
Calling this function causes a system-wide reset. This sets\r
CpuDeadLoop ();\r
}\r
\r
-/**\r
- Calling this function causes the system to enter a power state equivalent\r
- to the ACPI G2/S5 or G3 states.\r
-\r
- System shutdown should not return, if it returns, it means the system does\r
- not support shut down reset.\r
-**/\r
-VOID\r
-EFIAPI\r
-ResetShutdown (\r
- VOID\r
- )\r
-{\r
- AcpiPmControl (0);\r
- ASSERT (FALSE);\r
-}\r
-\r
-\r
/**\r
This function causes a systemwide reset. The exact type of the reset is\r
defined by the EFI_GUID that follows the Null-terminated Unicode string\r
VOID\r
EFIAPI\r
ResetPlatformSpecific (\r
- IN UINTN DataSize,\r
- IN VOID *ResetData\r
+ IN UINTN DataSize,\r
+ IN VOID *ResetData\r
)\r
{\r
ResetCold ();\r
VOID\r
EFIAPI\r
ResetSystem (\r
- IN EFI_RESET_TYPE ResetType,\r
- IN EFI_STATUS ResetStatus,\r
- IN UINTN DataSize,\r
- IN VOID *ResetData OPTIONAL\r
+ IN EFI_RESET_TYPE ResetType,\r
+ IN EFI_STATUS ResetStatus,\r
+ IN UINTN DataSize,\r
+ IN VOID *ResetData OPTIONAL\r
)\r
{\r
switch (ResetType) {\r
- case EfiResetWarm:\r
- ResetWarm ();\r
- break;\r
+ case EfiResetWarm:\r
+ ResetWarm ();\r
+ break;\r
\r
- case EfiResetCold:\r
- ResetCold ();\r
- break;\r
+ case EfiResetCold:\r
+ ResetCold ();\r
+ break;\r
\r
- case EfiResetShutdown:\r
- ResetShutdown ();\r
- return;\r
+ case EfiResetShutdown:\r
+ ResetShutdown ();\r
+ break;\r
\r
- case EfiResetPlatformSpecific:\r
- ResetPlatformSpecific (DataSize, ResetData);\r
- return;\r
+ case EfiResetPlatformSpecific:\r
+ ResetPlatformSpecific (DataSize, ResetData);\r
+ break;\r
\r
- default:\r
- return;\r
+ default:\r
+ break;\r
}\r
}\r