diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:13 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 47d20b54f9a65b08aa602a1866c1b59a69088dfc (patch) | |
tree | e3241dd169bda79544a36248e834a4bebe298418 /ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | |
parent | c411b485b63a671a1e276700cff025c73997233c (diff) | |
download | edk2-47d20b54f9a65b08aa602a1866c1b59a69088dfc.tar.gz edk2-47d20b54f9a65b08aa602a1866c1b59a69088dfc.tar.bz2 edk2-47d20b54f9a65b08aa602a1866c1b59a69088dfc.zip |
ShellPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the ShellPkg 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: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c')
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 244 |
1 files changed, 123 insertions, 121 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c index b9b67820b8..2980704479 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -16,10 +16,10 @@ #include "AcpiViewConfig.h"
// Local Variables
-STATIC CONST UINT8* SratRAType;
-STATIC CONST UINT8* SratRALength;
-STATIC CONST UINT8* SratDeviceHandleType;
-STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
+STATIC CONST UINT8 *SratRAType;
+STATIC CONST UINT8 *SratRALength;
+STATIC CONST UINT8 *SratDeviceHandleType;
+STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/**
This function validates the Reserved field in the SRAT table header.
@@ -32,11 +32,11 @@ STATIC VOID
EFIAPI
ValidateSratReserved (
- IN UINT8* Ptr,
- IN VOID* Context
+ IN UINT8 *Ptr,
+ IN VOID *Context
)
{
- if (*(UINT32*)Ptr != 1) {
+ if (*(UINT32 *)Ptr != 1) {
IncrementErrorCount ();
Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n");
}
@@ -54,11 +54,11 @@ STATIC VOID
EFIAPI
ValidateSratDeviceHandleType (
- IN UINT8* Ptr,
- IN VOID* Context
+ IN UINT8 *Ptr,
+ IN VOID *Context
)
{
- UINT8 DeviceHandleType;
+ UINT8 DeviceHandleType;
DeviceHandleType = *Ptr;
@@ -82,11 +82,11 @@ STATIC VOID
EFIAPI
DumpSratPciBdfNumber (
- IN CONST CHAR16* Format,
- IN UINT8* Ptr
+ IN CONST CHAR16 *Format,
+ IN UINT8 *Ptr
)
{
- CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
+ CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
Print (L"\n");
@@ -143,20 +143,20 @@ DumpSratPciBdfNumber ( /**
An ACPI_PARSER array describing the Device Handle - ACPI
**/
-STATIC CONST ACPI_PARSER SratDeviceHandleAcpiParser[] = {
- {L"ACPI_HID", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL},
- {L"ACPI_UID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratDeviceHandleAcpiParser[] = {
+ { L"ACPI_HID", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL },
+ { L"ACPI_UID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the Device Handle - PCI
**/
-STATIC CONST ACPI_PARSER SratDeviceHandlePciParser[] = {
- {L"PCI Segment", 2, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"PCI BDF Number", 2, 2, NULL, DumpSratPciBdfNumber, NULL, NULL, NULL},
- {L"Reserved", 12, 4, L"%x %x %x %x - %x %x %x %x - %x %x %x %x", Dump12Chars,
- NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratDeviceHandlePciParser[] = {
+ { L"PCI Segment", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"PCI BDF Number", 2, 2, NULL, DumpSratPciBdfNumber, NULL, NULL, NULL },
+ { L"Reserved", 12, 4, L"%x %x %x %x - %x %x %x %x - %x %x %x %x", Dump12Chars,
+ NULL, NULL, NULL }
};
/**
@@ -170,9 +170,9 @@ STATIC VOID
EFIAPI
DumpSratDeviceHandle (
- IN CONST CHAR16* Format,
- IN UINT8* Ptr
- )
+ IN CONST CHAR16 *Format,
+ IN UINT8 *Ptr
+ )
{
if (SratDeviceHandleType == NULL) {
IncrementErrorCount ();
@@ -213,11 +213,11 @@ STATIC VOID
EFIAPI
DumpSratApicProximity (
- IN CONST CHAR16* Format,
- IN UINT8* Ptr
- )
+ IN CONST CHAR16 *Format,
+ IN UINT8 *Ptr
+ )
{
- UINT32 ProximityDomain;
+ UINT32 ProximityDomain;
ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
@@ -227,108 +227,108 @@ DumpSratApicProximity ( /**
An ACPI_PARSER array describing the SRAT Table.
**/
-STATIC CONST ACPI_PARSER SratParser[] = {
+STATIC CONST ACPI_PARSER SratParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
- {L"Reserved", 4, 36, L"0x%x", NULL, NULL, ValidateSratReserved, NULL},
- {L"Reserved", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL}
+ { L"Reserved", 4, 36, L"0x%x", NULL, NULL, ValidateSratReserved, NULL },
+ { L"Reserved", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the Resource Allocation structure header.
**/
-STATIC CONST ACPI_PARSER SratResourceAllocationParser[] = {
- {L"Type", 1, 0, NULL, NULL, (VOID**)&SratRAType, NULL, NULL},
- {L"Length", 1, 1, NULL, NULL, (VOID**)&SratRALength, NULL, NULL}
+STATIC CONST ACPI_PARSER SratResourceAllocationParser[] = {
+ { L"Type", 1, 0, NULL, NULL, (VOID **)&SratRAType, NULL, NULL },
+ { L"Length", 1, 1, NULL, NULL, (VOID **)&SratRALength, NULL, NULL }
};
/**
An ACPI_PARSER array describing the GICC Affinity structure.
**/
-STATIC CONST ACPI_PARSER SratGicCAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
-
- {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"ACPI Processor UID", 4, 6, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Flags", 4, 10, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Clock Domain", 4, 14, L"0x%x", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratGicCAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
+
+ { L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"ACPI Processor UID", 4, 6, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Flags", 4, 10, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Clock Domain", 4, 14, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the GIC ITS Affinity structure.
**/
-STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
+STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
- {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL},
- {L"ITS Id", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
+ { L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"ITS Id", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
};
/**
An ACPI_PARSER array describing the Generic Initiator Affinity Structure
**/
-STATIC CONST ACPI_PARSER SratGenericInitiatorAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
-
- {L"Reserved", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Device Handle Type", 1, 3, L"%d", NULL, (VOID**)&SratDeviceHandleType,
- ValidateSratDeviceHandleType, NULL},
- {L"Proximity Domain", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Device Handle", 16, 8, L"%s", DumpSratDeviceHandle, NULL, NULL, NULL},
- {L"Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratGenericInitiatorAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
+
+ { L"Reserved", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Device Handle Type", 1, 3, L"%d", NULL, (VOID **)&SratDeviceHandleType,
+ ValidateSratDeviceHandleType, NULL },
+ { L"Proximity Domain", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Device Handle", 16, 8, L"%s", DumpSratDeviceHandle, NULL, NULL, NULL },
+ { L"Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 4, 28, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the Memory Affinity structure.
**/
-STATIC CONST ACPI_PARSER SratMemAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
-
- {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Base Address Low", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Base Address High", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length Low", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length High", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Flags", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratMemAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
+
+ { L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Base Address Low", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Base Address High", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length Low", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length High", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Flags", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the APIC/SAPIC Affinity structure.
**/
-STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
-
- {L"Proximity Domain [7:0]", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"APIC ID", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Local SAPIC EID", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Proximity Domain [31:8]", 3, 9, L"0x%x", DumpSratApicProximity,
- NULL, NULL, NULL},
- {L"Clock Domain", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
+
+ { L"Proximity Domain [7:0]", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"APIC ID", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Local SAPIC EID", 1, 8, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Proximity Domain [31:8]", 3, 9, L"0x%x", DumpSratApicProximity,
+ NULL, NULL, NULL },
+ { L"Clock Domain", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the Processor Local x2APIC Affinity structure.
**/
-STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
- {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
-
- {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Proximity Domain", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
- {L"X2APIC ID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Flags", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Clock Domain", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL}
+STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
+ { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
+
+ { L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Proximity Domain", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"X2APIC ID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Flags", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Clock Domain", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
+ { L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
@@ -352,28 +352,28 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = { VOID
EFIAPI
ParseAcpiSrat (
- IN BOOLEAN Trace,
- IN UINT8* Ptr,
- IN UINT32 AcpiTableLength,
- IN UINT8 AcpiTableRevision
+ IN BOOLEAN Trace,
+ IN UINT8 *Ptr,
+ IN UINT32 AcpiTableLength,
+ IN UINT8 AcpiTableRevision
)
{
- UINT32 Offset;
- UINT8* ResourcePtr;
- UINT32 GicCAffinityIndex;
- UINT32 GicITSAffinityIndex;
- UINT32 GenericInitiatorAffinityIndex;
- UINT32 MemoryAffinityIndex;
- UINT32 ApicSapicAffinityIndex;
- UINT32 X2ApicAffinityIndex;
- CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi
-
- GicCAffinityIndex = 0;
- GicITSAffinityIndex = 0;
+ UINT32 Offset;
+ UINT8 *ResourcePtr;
+ UINT32 GicCAffinityIndex;
+ UINT32 GicITSAffinityIndex;
+ UINT32 GenericInitiatorAffinityIndex;
+ UINT32 MemoryAffinityIndex;
+ UINT32 ApicSapicAffinityIndex;
+ UINT32 X2ApicAffinityIndex;
+ CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi
+
+ GicCAffinityIndex = 0;
+ GicITSAffinityIndex = 0;
GenericInitiatorAffinityIndex = 0;
- MemoryAffinityIndex = 0;
- ApicSapicAffinityIndex = 0;
- X2ApicAffinityIndex = 0;
+ MemoryAffinityIndex = 0;
+ ApicSapicAffinityIndex = 0;
+ X2ApicAffinityIndex = 0;
if (!Trace) {
return;
@@ -403,11 +403,12 @@ ParseAcpiSrat ( // Check if the values used to control the parsing logic have been
// successfully read.
if ((SratRAType == NULL) ||
- (SratRALength == NULL)) {
+ (SratRALength == NULL))
+ {
IncrementErrorCount ();
Print (
L"ERROR: Insufficient remaining table buffer length to read the " \
- L"Static Resource Allocation structure header. Length = %d.\n",
+ L"Static Resource Allocation structure header. Length = %d.\n",
AcpiTableLength - Offset
);
return;
@@ -415,11 +416,12 @@ ParseAcpiSrat ( // Validate Static Resource Allocation Structure length
if ((*SratRALength == 0) ||
- ((Offset + (*SratRALength)) > AcpiTableLength)) {
+ ((Offset + (*SratRALength)) > AcpiTableLength))
+ {
IncrementErrorCount ();
Print (
L"ERROR: Invalid Static Resource Allocation Structure length. " \
- L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
+ L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
*SratRALength,
Offset,
AcpiTableLength
@@ -451,7 +453,7 @@ ParseAcpiSrat ( sizeof (Buffer),
"GIC ITS Affinity Structure [%d]",
GicITSAffinityIndex++
- );
+ );
ParseAcpi (
TRUE,
2,
@@ -468,7 +470,7 @@ ParseAcpiSrat ( sizeof (Buffer),
"Generic Initiator Affinity Structure [%d]",
GenericInitiatorAffinityIndex++
- );
+ );
ParseAcpi (
TRUE,
2,
@@ -476,7 +478,7 @@ ParseAcpiSrat ( ResourcePtr,
*SratRALength,
PARSER_PARAMS (SratGenericInitiatorAffinityParser)
- );
+ );
break;
case EFI_ACPI_6_3_MEMORY_AFFINITY:
@@ -537,6 +539,6 @@ ParseAcpiSrat ( }
ResourcePtr += (*SratRALength);
- Offset += (*SratRALength);
+ Offset += (*SratRALength);
}
}
|