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>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:13 -08:00
committed by mergify[bot]
parent c411b485b6
commit 47d20b54f9
211 changed files with 30269 additions and 27004 deletions

View File

@ -21,27 +21,27 @@
#include "AcpiView.h"
// Maximum Memory Domain matrix print size.
#define MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX 10
#define MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX 10
// Local variables
STATIC CONST UINT16* HmatStructureType;
STATIC CONST UINT32* HmatStructureLength;
STATIC CONST UINT16 *HmatStructureType;
STATIC CONST UINT32 *HmatStructureLength;
STATIC CONST UINT32* NumberInitiatorProximityDomain;
STATIC CONST UINT32* NumberTargetProximityDomain;
STATIC CONST UINT32 *NumberInitiatorProximityDomain;
STATIC CONST UINT32 *NumberTargetProximityDomain;
STATIC CONST
EFI_ACPI_6_4_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO_FLAGS*
SllbiFlags;
EFI_ACPI_6_4_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO_FLAGS *
SllbiFlags;
STATIC CONST UINT8* SllbiDataType;
STATIC CONST UINT16* NumberSMBIOSHandles;
STATIC CONST UINT8 *SllbiDataType;
STATIC CONST UINT16 *NumberSMBIOSHandles;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/**
Names of System Locality Latency Bandwidth Information (SLLBI) data types
**/
STATIC CONST CHAR16* SllbiNames[] = {
STATIC CONST CHAR16 *SllbiNames[] = {
L"Access %sLatency%s",
L"Read %sLatency%s",
L"Write %sLatency%s",
@ -61,15 +61,15 @@ STATIC
VOID
EFIAPI
ValidateCacheAttributes (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES*
Attributes;
EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES *
Attributes;
Attributes =
(EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES*)Ptr;
(EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES *)Ptr;
if (Attributes->TotalCacheLevels > 0x3) {
IncrementErrorCount ();
@ -78,6 +78,7 @@ ValidateCacheAttributes (
Attributes->TotalCacheLevels
);
}
if (Attributes->CacheLevel > 0x3) {
IncrementErrorCount ();
Print (
@ -85,6 +86,7 @@ ValidateCacheAttributes (
Attributes->CacheLevel
);
}
if (Attributes->CacheAssociativity > 0x2) {
IncrementErrorCount ();
Print (
@ -92,6 +94,7 @@ ValidateCacheAttributes (
Attributes->CacheAssociativity
);
}
if (Attributes->WritePolicy > 0x2) {
IncrementErrorCount ();
Print (
@ -111,15 +114,15 @@ STATIC
VOID
EFIAPI
DumpCacheAttributes (
IN CONST CHAR16* Format OPTIONAL,
IN UINT8* Ptr
IN CONST CHAR16 *Format OPTIONAL,
IN UINT8 *Ptr
)
{
EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES*
Attributes;
EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES *
Attributes;
Attributes =
(EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES*)Ptr;
(EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES *)Ptr;
Print (L"\n");
PrintFieldName (4, L"Total Cache Levels");
@ -137,55 +140,55 @@ DumpCacheAttributes (
/**
An ACPI_PARSER array describing the ACPI HMAT Table.
*/
STATIC CONST ACPI_PARSER HmatParser[] = {
STATIC CONST ACPI_PARSER HmatParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Reserved", 4, 36, NULL, NULL, NULL, NULL, NULL}
{ L"Reserved", 4,36, NULL, NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the HMAT structure header.
*/
STATIC CONST ACPI_PARSER HmatStructureHeaderParser[] = {
{L"Type", 2, 0, NULL, NULL, (VOID**)&HmatStructureType, NULL, NULL},
{L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL},
{L"Length", 4, 4, NULL, NULL, (VOID**)&HmatStructureLength, NULL, NULL}
STATIC CONST ACPI_PARSER HmatStructureHeaderParser[] = {
{ L"Type", 2, 0, NULL, NULL, (VOID **)&HmatStructureType, NULL, NULL },
{ L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, NULL, NULL, (VOID **)&HmatStructureLength, NULL, NULL }
};
/**
An ACPI PARSER array describing the Memory Proximity Domain Attributes
Structure - Type 0.
*/
STATIC CONST ACPI_PARSER MemProximityDomainAttributeParser[] = {
{L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL},
{L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 2, 10, L"0x%x", NULL, NULL, NULL, NULL},
{L"Proximity Dom for initiator", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
{L"Proximity Dom for memory", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL}
STATIC CONST ACPI_PARSER MemProximityDomainAttributeParser[] = {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 10, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for initiator", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for memory", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL }
};
/**
An ACPI PARSER array describing the System Locality Latency and Bandwidth
Information Structure - Type 1.
*/
STATIC CONST ACPI_PARSER SllbiParser[] = {
{L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL},
{L"Flags", 1, 8, L"0x%x", NULL, (VOID**)&SllbiFlags, NULL, NULL},
{L"Data type", 1, 9, L"0x%x", NULL, (VOID**)&SllbiDataType, NULL, NULL},
{L"Min Transfer Size", 1, 10, L"%d", NULL, NULL, NULL, NULL},
{L"Reserved", 1, 11, L"0x%x", NULL, NULL, NULL, NULL},
{L"Initiator Proximity Dom Count", 4, 12, L"%d", NULL,
(VOID**)&NumberInitiatorProximityDomain, NULL, NULL},
{L"Target Proximity Dom Count", 4, 16, L"%d", NULL,
(VOID**)&NumberTargetProximityDomain, NULL, NULL},
{L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
{L"Entry Base Unit", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL}
STATIC CONST ACPI_PARSER SllbiParser[] = {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Flags", 1, 8, L"0x%x", NULL, (VOID **)&SllbiFlags, NULL, NULL },
{ L"Data type", 1, 9, L"0x%x", NULL, (VOID **)&SllbiDataType, NULL, NULL },
{ L"Min Transfer Size", 1, 10, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 11, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Initiator Proximity Dom Count", 4, 12, L"%d", NULL,
(VOID **)&NumberInitiatorProximityDomain, NULL, NULL },
{ L"Target Proximity Dom Count", 4, 16, L"%d", NULL,
(VOID **)&NumberTargetProximityDomain, NULL, NULL },
{ L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Entry Base Unit", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL }
// initiator Proximity Domain list ...
// target Proximity Domain list ...
// Latency/Bandwidth matrix ...
@ -195,18 +198,18 @@ STATIC CONST ACPI_PARSER SllbiParser[] = {
An ACPI PARSER array describing the Memory Side Cache Information
Structure - Type 2.
*/
STATIC CONST ACPI_PARSER MemSideCacheInfoParser[] = {
{L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL},
{L"Proximity Dom for memory", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
{L"Memory Side Cache Size", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Cache Attributes", 4, 24, NULL, DumpCacheAttributes, NULL,
ValidateCacheAttributes, NULL},
{L"Reserved", 2, 28, L"0x%x", NULL, NULL, NULL, NULL},
{L"SMBIOS Handle Count", 2, 30, L"%d", NULL,
(VOID**)&NumberSMBIOSHandles, NULL, NULL}
STATIC CONST ACPI_PARSER MemSideCacheInfoParser[] = {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for memory", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Memory Side Cache Size", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Cache Attributes", 4, 24, NULL, DumpCacheAttributes, NULL,
ValidateCacheAttributes, NULL },
{ L"Reserved", 2, 28, L"0x%x", NULL, NULL, NULL, NULL },
{ L"SMBIOS Handle Count", 2, 30, L"%d", NULL,
(VOID **)&NumberSMBIOSHandles, NULL, NULL }
// SMBIOS handles List ...
};
@ -222,8 +225,8 @@ STATIC CONST ACPI_PARSER MemSideCacheInfoParser[] = {
STATIC
VOID
DumpMpda (
IN UINT8* Ptr,
IN UINT32 Length
IN UINT8 *Ptr,
IN UINT32 Length
)
{
ParseAcpi (
@ -248,13 +251,13 @@ DumpMpda (
STATIC
VOID
DumpSllbi (
IN UINT8* Ptr,
IN UINT32 Length
IN UINT8 *Ptr,
IN UINT32 Length
)
{
CONST UINT32* InitiatorProximityDomainList;
CONST UINT32* TargetProximityDomainList;
CONST UINT16* LatencyBandwidthMatrix;
CONST UINT32 *InitiatorProximityDomainList;
CONST UINT32 *TargetProximityDomainList;
CONST UINT16 *LatencyBandwidthMatrix;
UINT32 Offset;
CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
CHAR16 SecondBuffer[OUTPUT_FIELD_COLUMN_WIDTH];
@ -278,11 +281,12 @@ DumpSllbi (
if ((SllbiFlags == NULL) ||
(SllbiDataType == NULL) ||
(NumberInitiatorProximityDomain == NULL) ||
(NumberTargetProximityDomain == NULL)) {
(NumberTargetProximityDomain == NULL))
{
IncrementErrorCount ();
Print (
L"ERROR: Insufficient remaining table buffer length to read the " \
L"SLLBI structure header. Length = %d.\n",
L"SLLBI structure header. Length = %d.\n",
Length
);
return;
@ -306,10 +310,10 @@ DumpSllbi (
return;
}
InitiatorProximityDomainList = (UINT32*) (Ptr + Offset);
TargetProximityDomainList = InitiatorProximityDomainList +
*NumberInitiatorProximityDomain;
LatencyBandwidthMatrix = (UINT16*) (TargetProximityDomainList +
InitiatorProximityDomainList = (UINT32 *)(Ptr + Offset);
TargetProximityDomainList = InitiatorProximityDomainList +
*NumberInitiatorProximityDomain;
LatencyBandwidthMatrix = (UINT16 *)(TargetProximityDomainList +
*NumberTargetProximityDomain);
// Display each element of the Initiator Proximity Domain list
@ -350,6 +354,7 @@ DumpSllbi (
Print (L"Error: Unkown Data Type. DataType = 0x%x.\n", *SllbiDataType);
return;
}
StrCpyS (Buffer, sizeof (Buffer), SllbiNames[*SllbiDataType]);
// Adjust base name depending on Memory Hierarchy in this Structure
@ -381,7 +386,6 @@ DumpSllbi (
SllbiFlags->MemoryHierarchy
);
return;
} // switch
if (*NumberTargetProximityDomain <= MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX) {
@ -400,34 +404,41 @@ DumpSllbi (
for (IndexTarget = 0;
IndexTarget < *NumberTargetProximityDomain;
IndexTarget++) {
IndexTarget++)
{
Print (L" %2d", IndexTarget);
}
Print (L"\n ---+");
for (IndexTarget = 0;
IndexTarget < *NumberTargetProximityDomain;
IndexTarget++) {
IndexTarget++)
{
Print (L"------");
}
Print (L"\n");
TargetStartOffset = 0;
for (IndexInitiator = 0;
IndexInitiator < *NumberInitiatorProximityDomain;
IndexInitiator++) {
IndexInitiator++)
{
Print (L" %2d |", IndexInitiator);
for (IndexTarget = 0;
IndexTarget < *NumberTargetProximityDomain;
IndexTarget++) {
IndexTarget++)
{
Print (
L" %5d",
LatencyBandwidthMatrix[TargetStartOffset + IndexTarget]
);
} // for Target
Print (L"\n");
TargetStartOffset += (*NumberTargetProximityDomain);
} // for Initiator
Print (L"\n");
} else {
// Display the latency/bandwidth matrix as a list
@ -441,10 +452,12 @@ DumpSllbi (
TargetStartOffset = 0;
for (IndexInitiator = 0;
IndexInitiator < *NumberInitiatorProximityDomain;
IndexInitiator++) {
IndexInitiator++)
{
for (IndexTarget = 0;
IndexTarget < *NumberTargetProximityDomain;
IndexTarget++) {
IndexTarget++)
{
UnicodeSPrint (
SecondBuffer,
sizeof (SecondBuffer),
@ -459,6 +472,7 @@ DumpSllbi (
LatencyBandwidthMatrix[TargetStartOffset + IndexTarget]
);
} // for Target
TargetStartOffset += (*NumberTargetProximityDomain);
} // for Initiator
}
@ -474,11 +488,11 @@ DumpSllbi (
STATIC
VOID
DumpMsci (
IN UINT8* Ptr,
IN UINT32 Length
IN UINT8 *Ptr,
IN UINT32 Length
)
{
CONST UINT16* SMBIOSHandlesList;
CONST UINT16 *SMBIOSHandlesList;
CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
UINT32 Offset;
UINT16 Index;
@ -498,7 +512,7 @@ DumpMsci (
IncrementErrorCount ();
Print (
L"ERROR: Insufficient remaining table buffer length to read the " \
L"MSCI structure header. Length = %d.\n",
L"MSCI structure header. Length = %d.\n",
Length
);
return;
@ -515,7 +529,7 @@ DumpMsci (
return;
}
SMBIOSHandlesList = (UINT16*) (Ptr + Offset);
SMBIOSHandlesList = (UINT16 *)(Ptr + Offset);
for (Index = 0; Index < *NumberSMBIOSHandles; Index++) {
UnicodeSPrint (
@ -553,14 +567,14 @@ DumpMsci (
VOID
EFIAPI
ParseAcpiHmat (
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* HmatStructurePtr;
UINT32 Offset;
UINT8 *HmatStructurePtr;
if (!Trace) {
return;
@ -591,11 +605,12 @@ ParseAcpiHmat (
// Check if the values used to control the parsing logic have been
// successfully read.
if ((HmatStructureType == NULL) ||
(HmatStructureLength == NULL)) {
(HmatStructureLength == NULL))
{
IncrementErrorCount ();
Print (
L"ERROR: Insufficient remaining table buffer length to read the " \
L"HMAT structure header. Length = %d.\n",
L"HMAT structure header. Length = %d.\n",
AcpiTableLength - Offset
);
return;
@ -603,11 +618,12 @@ ParseAcpiHmat (
// Validate HMAT Structure length.
if ((*HmatStructureLength == 0) ||
((Offset + (*HmatStructureLength)) > AcpiTableLength)) {
((Offset + (*HmatStructureLength)) > AcpiTableLength))
{
IncrementErrorCount ();
Print (
L"ERROR: Invalid HMAT Structure length. " \
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
*HmatStructureLength,
Offset,
AcpiTableLength
@ -629,7 +645,7 @@ ParseAcpiHmat (
);
break;
case EFI_ACPI_6_4_HMAT_TYPE_MEMORY_SIDE_CACHE_INFO:
DumpMsci (
DumpMsci (
HmatStructurePtr,
*HmatStructureLength
);
@ -638,7 +654,7 @@ ParseAcpiHmat (
IncrementErrorCount ();
Print (
L"ERROR: Unknown HMAT structure:"
L" Type = %d, Length = %d\n",
L" Type = %d, Length = %d\n",
*HmatStructureType,
*HmatStructureLength
);
@ -646,6 +662,6 @@ ParseAcpiHmat (
} // switch
HmatStructurePtr += *HmatStructureLength;
Offset += *HmatStructureLength;
Offset += *HmatStructureLength;
} // while
}