X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FLibrary%2FResetSystemLib%2FResetSystemLib.c;h=fe51f53d1df2d057aeb959fb7161e579b4359f13;hb=b6d542e927a3fa0ff4fd7278917f25b0494c07ba;hp=27460cd100ab9cc3b31608861aee00bfd91355ff;hpb=84c0b80de7162c068aead20450528098afd1fe4a;p=mirror_edk2.git diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c index 27460cd100..fe51f53d1d 100644 --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -6,44 +6,12 @@ **/ -#include +#include // BIT1 -#include -#include -#include -#include -#include - -#include - -VOID -AcpiPmControl ( - UINTN SuspendType - ) -{ - UINT16 AcpiPmBaseAddress; - UINT16 HostBridgeDevId; - - ASSERT (SuspendType < 6); - - AcpiPmBaseAddress = 0; - HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID); - switch (HostBridgeDevId) { - case INTEL_82441_DEVICE_ID: - AcpiPmBaseAddress = PIIX4_PMBA_VALUE; - break; - case INTEL_Q35_MCH_DEVICE_ID: - AcpiPmBaseAddress = ICH9_PMBASE_VALUE; - break; - default: - ASSERT (FALSE); - CpuDeadLoop (); - } - - IoBitFieldWrite16 (AcpiPmBaseAddress + 4, 10, 13, (UINT16) SuspendType); - IoOr16 (AcpiPmBaseAddress + 4, BIT13); - CpuDeadLoop (); -} +#include // CpuDeadLoop() +#include // IoWrite8() +#include // ResetCold() +#include // MicroSecondDelay() /** Calling this function causes a system-wide reset. This sets @@ -84,48 +52,14 @@ ResetWarm ( CpuDeadLoop (); } -/** - Calling this function causes the system to enter a power state equivalent - to the ACPI G2/S5 or G3 states. - - System shutdown should not return, if it returns, it means the system does - not support shut down reset. -**/ -VOID -EFIAPI -ResetShutdown ( - VOID - ) -{ - AcpiPmControl (0); - ASSERT (FALSE); -} - - -/** - Calling this function causes the system to enter a power state for capsule - update. - - Reset update should not return, if it returns, it means the system does - not support capsule update. - -**/ -VOID -EFIAPI -EnterS3WithImmediateWake ( - VOID - ) -{ - AcpiPmControl (1); - ASSERT (FALSE); -} /** This function causes a systemwide reset. The exact type of the reset is - defined by the EFI_GUID that follows the Null-terminated Unicode string passed - into ResetData. If the platform does not recognize the EFI_GUID in ResetData - the platform must pick a supported reset type to perform.The platform may - optionally log the parameters from any non-normal reset that occurs. + defined by the EFI_GUID that follows the Null-terminated Unicode string + passed into ResetData. If the platform does not recognize the EFI_GUID in + ResetData the platform must pick a supported reset type to perform.The + platform may optionally log the parameters from any non-normal reset that + occurs. @param[in] DataSize The size, in bytes, of ResetData. @param[in] ResetData The data buffer starts with a Null-terminated string, @@ -147,11 +81,12 @@ ResetPlatformSpecific ( @param[in] ResetType The type of reset to perform. @param[in] ResetStatus The status code for the reset. @param[in] DataSize The size, in bytes, of ResetData. - @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown - the data buffer starts with a Null-terminated string, optionally - followed by additional binary data. The string is a description - that the caller may use to further indicate the reason for the - system reset. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or + EfiResetShutdown the data buffer starts with a + Null-terminated string, optionally followed by + additional binary data. The string is a description + that the caller may use to further indicate the + reason for the system reset. **/ VOID EFIAPI @@ -173,13 +108,13 @@ ResetSystem ( case EfiResetShutdown: ResetShutdown (); - return; + break; case EfiResetPlatformSpecific: ResetPlatformSpecific (DataSize, ResetData); - return; + break; default: - return; + break; } }