diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:53:52 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 2b16a4fb91b9b31c0d152588f5ac51080c6c0763 (patch) | |
tree | 72c352a8e807a4720c1675a755969206c6370588 /ArmVirtPkg/Library/QemuVirtMemInfoLib | |
parent | 40b0b23ed34f48c26d711d3e4613a4bb35eeadff (diff) | |
download | edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.gz edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.bz2 edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.zip |
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/Library/QemuVirtMemInfoLib')
-rw-r--r-- | ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 33 | ||||
-rw-r--r-- | ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c | 44 |
2 files changed, 45 insertions, 32 deletions
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c index 7ae837b186..cf569bed99 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c @@ -13,7 +13,7 @@ #include <Library/MemoryAllocationLib.h>
// Number of Virtual Memory Map Descriptors
-#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5
//
// mach-virt's core peripherals such as the UART, the GIC and the RTC are
@@ -21,8 +21,8 @@ // in its entirety rather than device by device. Note that it does not
// cover any of the NOR flash banks or PCI resource windows.
//
-#define MACH_VIRT_PERIPH_BASE 0x08000000
-#define MACH_VIRT_PERIPH_SIZE SIZE_128MB
+#define MACH_VIRT_PERIPH_BASE 0x08000000
+#define MACH_VIRT_PERIPH_SIZE SIZE_128MB
/**
Return the Virtual Memory Map of your platform
@@ -39,15 +39,17 @@ **/
VOID
ArmVirtGetMemoryMap (
- OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap
+ OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap
)
{
ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable;
ASSERT (VirtualMemoryMap != NULL);
- VirtualMemoryTable = AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *
- MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
+ VirtualMemoryTable = AllocatePool (
+ sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *
+ MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS
+ );
if (VirtualMemoryTable == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION__));
@@ -60,14 +62,17 @@ ArmVirtGetMemoryMap ( VirtualMemoryTable[0].Length = PcdGet64 (PcdSystemMemorySize);
VirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
- DEBUG ((DEBUG_INFO, "%a: Dumping System DRAM Memory Map:\n"
- "\tPhysicalBase: 0x%lX\n"
- "\tVirtualBase: 0x%lX\n"
- "\tLength: 0x%lX\n",
- __FUNCTION__,
- VirtualMemoryTable[0].PhysicalBase,
- VirtualMemoryTable[0].VirtualBase,
- VirtualMemoryTable[0].Length));
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: Dumping System DRAM Memory Map:\n"
+ "\tPhysicalBase: 0x%lX\n"
+ "\tVirtualBase: 0x%lX\n"
+ "\tLength: 0x%lX\n",
+ __FUNCTION__,
+ VirtualMemoryTable[0].PhysicalBase,
+ VirtualMemoryTable[0].VirtualBase,
+ VirtualMemoryTable[0].Length
+ ));
// Memory mapped peripherals (UART, RTC, GIC, virtio-mmio, etc)
VirtualMemoryTable[1].PhysicalBase = MACH_VIRT_PERIPH_BASE;
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c index b32419b85c..33d3597d57 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c @@ -17,14 +17,14 @@ QemuVirtMemInfoPeiLibConstructor ( VOID
)
{
- VOID *DeviceTreeBase;
- INT32 Node, Prev;
- UINT64 NewBase, CurBase;
- UINT64 NewSize, CurSize;
- CONST CHAR8 *Type;
- INT32 Len;
- CONST UINT64 *RegProp;
- RETURN_STATUS PcdStatus;
+ VOID *DeviceTreeBase;
+ INT32 Node, Prev;
+ UINT64 NewBase, CurBase;
+ UINT64 NewSize, CurSize;
+ CONST CHAR8 *Type;
+ INT32 Len;
+ CONST UINT64 *RegProp;
+ RETURN_STATUS PcdStatus;
NewBase = 0;
NewSize = 0;
@@ -40,7 +40,7 @@ QemuVirtMemInfoPeiLibConstructor ( //
// Look for the lowest memory node
//
- for (Prev = 0;; Prev = Node) {
+ for (Prev = 0; ; Prev = Node) {
Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
if (Node < 0) {
break;
@@ -50,27 +50,34 @@ QemuVirtMemInfoPeiLibConstructor ( // Check for memory node
//
Type = fdt_getprop (DeviceTreeBase, Node, "device_type", &Len);
- if (Type && AsciiStrnCmp (Type, "memory", Len) == 0) {
+ if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) {
//
// Get the 'reg' property of this node. For now, we will assume
// two 8 byte quantities for base and size, respectively.
//
RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", &Len);
- if (RegProp != 0 && Len == (2 * sizeof (UINT64))) {
-
+ if ((RegProp != 0) && (Len == (2 * sizeof (UINT64)))) {
CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));
- DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n",
- __FUNCTION__, CurBase, CurBase + CurSize - 1));
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: System RAM @ 0x%lx - 0x%lx\n",
+ __FUNCTION__,
+ CurBase,
+ CurBase + CurSize - 1
+ ));
- if (NewBase > CurBase || NewBase == 0) {
+ if ((NewBase > CurBase) || (NewBase == 0)) {
NewBase = CurBase;
NewSize = CurSize;
}
} else {
- DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n",
- __FUNCTION__));
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a: Failed to parse FDT memory node\n",
+ __FUNCTION__
+ ));
}
}
}
@@ -94,7 +101,8 @@ QemuVirtMemInfoPeiLibConstructor ( ASSERT (
(((UINT64)PcdGet64 (PcdFdBaseAddress) +
(UINT64)PcdGet32 (PcdFdSize)) <= NewBase) ||
- ((UINT64)PcdGet64 (PcdFdBaseAddress) >= (NewBase + NewSize)));
+ ((UINT64)PcdGet64 (PcdFdBaseAddress) >= (NewBase + NewSize))
+ );
return RETURN_SUCCESS;
}
|