OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
This commit is contained in:
committed by
mergify[bot]
parent
d1050b9dff
commit
ac0a286f4d
@@ -28,21 +28,21 @@ ResetShutdown (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT16 AcpiPmBaseAddress;
|
||||
UINT16 HostBridgeDevId;
|
||||
UINT16 AcpiPmBaseAddress;
|
||||
UINT16 HostBridgeDevId;
|
||||
|
||||
AcpiPmBaseAddress = 0;
|
||||
HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
|
||||
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 ();
|
||||
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, 0);
|
||||
|
@@ -15,29 +15,29 @@
|
||||
#include <Library/ResetSystemLib.h> // ResetShutdown()
|
||||
#include <OvmfPlatforms.h> // PIIX4_PMBA_VALUE
|
||||
|
||||
STATIC UINT16 mAcpiPmBaseAddress;
|
||||
STATIC UINT16 mAcpiPmBaseAddress;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeResetInit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
UINT16 HostBridgeDevId;
|
||||
UINT16 HostBridgeDevId;
|
||||
|
||||
HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
|
||||
switch (HostBridgeDevId) {
|
||||
case INTEL_82441_DEVICE_ID:
|
||||
mAcpiPmBaseAddress = PIIX4_PMBA_VALUE;
|
||||
break;
|
||||
case INTEL_Q35_MCH_DEVICE_ID:
|
||||
mAcpiPmBaseAddress = ICH9_PMBASE_VALUE;
|
||||
break;
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
CpuDeadLoop ();
|
||||
return EFI_UNSUPPORTED;
|
||||
case INTEL_82441_DEVICE_ID:
|
||||
mAcpiPmBaseAddress = PIIX4_PMBA_VALUE;
|
||||
break;
|
||||
case INTEL_Q35_MCH_DEVICE_ID:
|
||||
mAcpiPmBaseAddress = ICH9_PMBASE_VALUE;
|
||||
break;
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
CpuDeadLoop ();
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -37,8 +37,11 @@ DxeResetSystemLibMicrovmConstructor (
|
||||
return RETURN_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = gDS->SetMemorySpaceAttributes (Address, SIZE_4KB,
|
||||
Descriptor.Attributes | EFI_MEMORY_RUNTIME);
|
||||
Status = gDS->SetMemorySpaceAttributes (
|
||||
Address,
|
||||
SIZE_4KB,
|
||||
Descriptor.Attributes | EFI_MEMORY_RUNTIME
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_INFO, "%a: SetMemorySpaceAttributes failed\n", __FUNCTION__));
|
||||
return RETURN_UNSUPPORTED;
|
||||
|
@@ -52,7 +52,6 @@ ResetWarm (
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
@@ -68,8 +67,8 @@ ResetWarm (
|
||||
VOID
|
||||
EFIAPI
|
||||
ResetPlatformSpecific (
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData
|
||||
)
|
||||
{
|
||||
ResetCold ();
|
||||
@@ -91,30 +90,30 @@ ResetPlatformSpecific (
|
||||
VOID
|
||||
EFIAPI
|
||||
ResetSystem (
|
||||
IN EFI_RESET_TYPE ResetType,
|
||||
IN EFI_STATUS ResetStatus,
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData OPTIONAL
|
||||
IN EFI_RESET_TYPE ResetType,
|
||||
IN EFI_STATUS ResetStatus,
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData OPTIONAL
|
||||
)
|
||||
{
|
||||
switch (ResetType) {
|
||||
case EfiResetWarm:
|
||||
ResetWarm ();
|
||||
break;
|
||||
case EfiResetWarm:
|
||||
ResetWarm ();
|
||||
break;
|
||||
|
||||
case EfiResetCold:
|
||||
ResetCold ();
|
||||
break;
|
||||
case EfiResetCold:
|
||||
ResetCold ();
|
||||
break;
|
||||
|
||||
case EfiResetShutdown:
|
||||
ResetShutdown ();
|
||||
break;
|
||||
case EfiResetShutdown:
|
||||
ResetShutdown ();
|
||||
break;
|
||||
|
||||
case EfiResetPlatformSpecific:
|
||||
ResetPlatformSpecific (DataSize, ResetData);
|
||||
break;
|
||||
case EfiResetPlatformSpecific:
|
||||
ResetPlatformSpecific (DataSize, ResetData);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -16,9 +16,12 @@
|
||||
#include <Library/UefiRuntimeLib.h> // EfiGoneVirtual()
|
||||
#include <OvmfPlatforms.h> // PIIX4_PMBA_VALUE
|
||||
|
||||
static UINTN MicrovmGedBase (VOID)
|
||||
static UINTN
|
||||
MicrovmGedBase (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
VOID *Address = (VOID*)(UINTN) MICROVM_GED_MMIO_BASE_REGS;
|
||||
VOID *Address = (VOID *)(UINTN)MICROVM_GED_MMIO_BASE_REGS;
|
||||
|
||||
if (EfiGoneVirtual ()) {
|
||||
EfiConvertPointer (0, &Address);
|
||||
@@ -27,63 +30,82 @@ static UINTN MicrovmGedBase (VOID)
|
||||
DEBUG ((DEBUG_INFO, "%a: physical -> 0x%x\n", __FUNCTION__, Address));
|
||||
}
|
||||
|
||||
return (UINTN) Address;
|
||||
return (UINTN)Address;
|
||||
}
|
||||
|
||||
static VOID MicrovmReset (VOID)
|
||||
static VOID
|
||||
MicrovmReset (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINTN Address = MicrovmGedBase();
|
||||
UINTN Address = MicrovmGedBase ();
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a: microvm reset via ged\n", __FUNCTION__));
|
||||
MmioWrite8 (Address + MICROVM_ACPI_GED_REG_RESET,
|
||||
MICROVM_ACPI_GED_RESET_VALUE);
|
||||
MmioWrite8 (
|
||||
Address + MICROVM_ACPI_GED_REG_RESET,
|
||||
MICROVM_ACPI_GED_RESET_VALUE
|
||||
);
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
static VOID MicrovmShutdown (VOID)
|
||||
static VOID
|
||||
MicrovmShutdown (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINTN Address = MicrovmGedBase();
|
||||
UINTN Address = MicrovmGedBase ();
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a: microvm poweroff via ged\n", __FUNCTION__));
|
||||
MmioWrite8 (Address + MICROVM_ACPI_GED_REG_SLEEP_CTL,
|
||||
(1 << 5) /* enable bit */ |
|
||||
(5 << 2) /* typ == S5 */);
|
||||
MmioWrite8 (
|
||||
Address + MICROVM_ACPI_GED_REG_SLEEP_CTL,
|
||||
(1 << 5) /* enable bit */ |
|
||||
(5 << 2) /* typ == S5 */
|
||||
);
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
VOID EFIAPI ResetCold (VOID)
|
||||
VOID EFIAPI
|
||||
ResetCold (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
MicrovmReset();
|
||||
MicrovmReset ();
|
||||
}
|
||||
|
||||
VOID EFIAPI ResetWarm (VOID)
|
||||
VOID EFIAPI
|
||||
ResetWarm (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
MicrovmReset();
|
||||
MicrovmReset ();
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ResetPlatformSpecific (
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData
|
||||
)
|
||||
{
|
||||
MicrovmReset();
|
||||
MicrovmReset ();
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ResetSystem (
|
||||
IN EFI_RESET_TYPE ResetType,
|
||||
IN EFI_STATUS ResetStatus,
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData OPTIONAL
|
||||
IN EFI_RESET_TYPE ResetType,
|
||||
IN EFI_STATUS ResetStatus,
|
||||
IN UINTN DataSize,
|
||||
IN VOID *ResetData OPTIONAL
|
||||
)
|
||||
{
|
||||
MicrovmReset();
|
||||
MicrovmReset ();
|
||||
}
|
||||
|
||||
VOID EFIAPI ResetShutdown (VOID)
|
||||
VOID EFIAPI
|
||||
ResetShutdown (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
MicrovmShutdown();
|
||||
MicrovmShutdown ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user