summaryrefslogtreecommitdiff
path: root/ArmVirtPkg/XenAcpiPlatformDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:52 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit2b16a4fb91b9b31c0d152588f5ac51080c6c0763 (patch)
tree72c352a8e807a4720c1675a755969206c6370588 /ArmVirtPkg/XenAcpiPlatformDxe
parent40b0b23ed34f48c26d711d3e4613a4bb35eeadff (diff)
downloadedk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.zip
edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.gz
edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.bz2
ArmVirtPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmVirtPkg 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: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmVirtPkg/XenAcpiPlatformDxe')
-rw-r--r--ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c152
1 files changed, 82 insertions, 70 deletions
diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
index 438b0ff..96bc442 100644
--- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
+++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
@@ -32,33 +32,44 @@ STATIC
EFI_STATUS
EFIAPI
GetXenArmAcpiRsdp (
- OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr
+ OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr
)
{
- EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdpStructurePtr;
- EFI_STATUS Status;
- FDT_CLIENT_PROTOCOL *FdtClient;
- CONST UINT64 *Reg;
- UINT32 RegSize;
- UINTN AddressCells, SizeCells;
- UINT64 RegBase;
- UINT8 Sum;
+ EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdpStructurePtr;
+ EFI_STATUS Status;
+ FDT_CLIENT_PROTOCOL *FdtClient;
+ CONST UINT64 *Reg;
+ UINT32 RegSize;
+ UINTN AddressCells, SizeCells;
+ UINT64 RegBase;
+ UINT8 Sum;
RsdpStructurePtr = NULL;
- FdtClient = NULL;
+ FdtClient = NULL;
//
// Get the RSDP structure address from DeviceTree
//
- Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
- (VOID **)&FdtClient);
+ Status = gBS->LocateProtocol (
+ &gFdtClientProtocolGuid,
+ NULL,
+ (VOID **)&FdtClient
+ );
ASSERT_EFI_ERROR (Status);
- Status = FdtClient->FindCompatibleNodeReg (FdtClient, "xen,guest-acpi",
- (CONST VOID **)&Reg, &AddressCells, &SizeCells,
- &RegSize);
+ Status = FdtClient->FindCompatibleNodeReg (
+ FdtClient,
+ "xen,guest-acpi",
+ (CONST VOID **)&Reg,
+ &AddressCells,
+ &SizeCells,
+ &RegSize
+ );
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_WARN, "%a: No 'xen,guest-acpi' compatible DT node found\n",
- __FUNCTION__));
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: No 'xen,guest-acpi' compatible DT node found\n",
+ __FUNCTION__
+ ));
return EFI_NOT_FOUND;
}
@@ -66,13 +77,15 @@ GetXenArmAcpiRsdp (
ASSERT (SizeCells == 2);
ASSERT (RegSize == 2 * sizeof (UINT64));
- RegBase = SwapBytes64(Reg[0]);
+ RegBase = SwapBytes64 (Reg[0]);
RsdpStructurePtr =
(EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)RegBase;
- if (RsdpStructurePtr && RsdpStructurePtr->Revision >= 2) {
- Sum = CalculateSum8 ((CONST UINT8 *)RsdpStructurePtr,
- sizeof (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER));
+ if (RsdpStructurePtr && (RsdpStructurePtr->Revision >= 2)) {
+ Sum = CalculateSum8 (
+ (CONST UINT8 *)RsdpStructurePtr,
+ sizeof (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER)
+ );
if (Sum != 0) {
return EFI_ABORTED;
}
@@ -101,26 +114,26 @@ STATIC
EFI_STATUS
EFIAPI
InstallXenArmTables (
- IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol
)
{
- EFI_STATUS Status;
- UINTN TableHandle;
- VOID *CurrentTableEntry;
- UINTN CurrentTablePointer;
- EFI_ACPI_DESCRIPTION_HEADER *CurrentTable;
- UINTN Index;
- UINTN NumberOfTableEntries;
- EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *XenAcpiRsdpStructurePtr;
- EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
- EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtTable;
- EFI_ACPI_DESCRIPTION_HEADER *DsdtTable;
+ EFI_STATUS Status;
+ UINTN TableHandle;
+ VOID *CurrentTableEntry;
+ UINTN CurrentTablePointer;
+ EFI_ACPI_DESCRIPTION_HEADER *CurrentTable;
+ UINTN Index;
+ UINTN NumberOfTableEntries;
+ EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *XenAcpiRsdpStructurePtr;
+ EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
+ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtTable;
+ EFI_ACPI_DESCRIPTION_HEADER *DsdtTable;
XenAcpiRsdpStructurePtr = NULL;
- FadtTable = NULL;
- DsdtTable = NULL;
- TableHandle = 0;
- NumberOfTableEntries = 0;
+ FadtTable = NULL;
+ DsdtTable = NULL;
+ TableHandle = 0;
+ NumberOfTableEntries = 0;
//
// Try to find Xen ARM ACPI tables
@@ -139,11 +152,11 @@ InstallXenArmTables (
// Retrieve the addresses of XSDT and
// calculate the number of its table entries.
//
- Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN)
- XenAcpiRsdpStructurePtr->XsdtAddress;
+ Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)
+ XenAcpiRsdpStructurePtr->XsdtAddress;
NumberOfTableEntries = (Xsdt->Length -
- sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /
- sizeof (UINT64);
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /
+ sizeof (UINT64);
//
// Install ACPI tables found in XSDT.
//
@@ -151,21 +164,21 @@ InstallXenArmTables (
//
// Get the table entry from XSDT
//
- CurrentTableEntry = (VOID *) ((UINT8 *) Xsdt +
- sizeof (EFI_ACPI_DESCRIPTION_HEADER) +
- Index * sizeof (UINT64));
- CurrentTablePointer = (UINTN) *(UINT64 *)CurrentTableEntry;
- CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer;
+ CurrentTableEntry = (VOID *)((UINT8 *)Xsdt +
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER) +
+ Index * sizeof (UINT64));
+ CurrentTablePointer = (UINTN)*(UINT64 *)CurrentTableEntry;
+ CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *)CurrentTablePointer;
//
// Install the XSDT tables
//
Status = AcpiProtocol->InstallAcpiTable (
- AcpiProtocol,
- CurrentTable,
- CurrentTable->Length,
- &TableHandle
- );
+ AcpiProtocol,
+ CurrentTable,
+ CurrentTable->Length,
+ &TableHandle
+ );
if (EFI_ERROR (Status)) {
return Status;
@@ -174,10 +187,10 @@ InstallXenArmTables (
//
// Get the FACS and DSDT table address from the table FADT
//
- if (!AsciiStrnCmp ((CHAR8 *) &CurrentTable->Signature, "FACP", 4)) {
+ if (!AsciiStrnCmp ((CHAR8 *)&CurrentTable->Signature, "FACP", 4)) {
FadtTable = (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *)
- (UINTN) CurrentTablePointer;
- DsdtTable = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) FadtTable->Dsdt;
+ (UINTN)CurrentTablePointer;
+ DsdtTable = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)FadtTable->Dsdt;
}
}
}
@@ -186,11 +199,11 @@ InstallXenArmTables (
// Install DSDT table.
//
Status = AcpiProtocol->InstallAcpiTable (
- AcpiProtocol,
- DsdtTable,
- DsdtTable->Length,
- &TableHandle
- );
+ AcpiProtocol,
+ DsdtTable,
+ DsdtTable->Length,
+ &TableHandle
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -204,15 +217,15 @@ FindAcpiTableProtocol (
VOID
)
{
- EFI_STATUS Status;
- EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
+ EFI_STATUS Status;
+ EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
AcpiTable = NULL;
- Status = gBS->LocateProtocol (
- &gEfiAcpiTableProtocolGuid,
- NULL,
- (VOID**)&AcpiTable
- );
+ Status = gBS->LocateProtocol (
+ &gEfiAcpiTableProtocolGuid,
+ NULL,
+ (VOID **)&AcpiTable
+ );
ASSERT_EFI_ERROR (Status);
return AcpiTable;
}
@@ -228,15 +241,14 @@ FindAcpiTableProtocol (
@return EFI_OUT_OF_RESOURCES
**/
-
EFI_STATUS
EFIAPI
XenAcpiPlatformEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = InstallXenArmTables (FindAcpiTableProtocol ());
return Status;