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

@ -17,12 +17,12 @@
#include "PcctParser.h"
// Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
STATIC UINT32* PccGlobalFlags;
STATIC UINT8* PccSubspaceLength;
STATIC UINT8* PccSubspaceType;
STATIC UINT8* ExtendedPccSubspaceInterruptFlags;
STATIC UINT32 *PccGlobalFlags;
STATIC UINT8 *PccSubspaceLength;
STATIC UINT8 *PccSubspaceType;
STATIC UINT8 *ExtendedPccSubspaceInterruptFlags;
/**
This function validates the length coded on 4 bytes of a shared memory range
@ -35,16 +35,16 @@ STATIC
VOID
EFIAPI
ValidateRangeLength4 (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
if (*(UINT32*)Ptr < MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN) {
if (*(UINT32 *)Ptr < MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN) {
IncrementErrorCount ();
Print (
L"\nError: Shared memory range length is too short.\n"
L"Length is %u when it should be greater than or equal to %u",
*(UINT32*)Ptr,
*(UINT32 *)Ptr,
MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN
);
}
@ -61,16 +61,16 @@ STATIC
VOID
EFIAPI
ValidateRangeLength8 (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
if (*(UINT64*)Ptr <= MIN_MEMORY_RANGE_LENGTH) {
if (*(UINT64 *)Ptr <= MIN_MEMORY_RANGE_LENGTH) {
IncrementErrorCount ();
Print (
L"\nError: Shared memory range length is too short.\n"
L"Length is %u when it should be greater than %u",
*(UINT64*)Ptr,
*(UINT64 *)Ptr,
MIN_MEMORY_RANGE_LENGTH
);
}
@ -87,14 +87,14 @@ STATIC
VOID
EFIAPI
ValidatePccMemoryIoGas (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
switch (*(UINT8*)Ptr) {
#if !(defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
switch (*(UINT8 *)Ptr) {
#if !(defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
case EFI_ACPI_6_4_SYSTEM_IO:
#endif //if not (defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
#endif //if not (defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
case EFI_ACPI_6_4_SYSTEM_MEMORY:
return;
default:
@ -114,14 +114,14 @@ STATIC
VOID
EFIAPI
ValidatePccGas (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
switch (*(UINT8*)Ptr) {
#if !(defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
switch (*(UINT8 *)Ptr) {
#if !(defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
case EFI_ACPI_6_4_SYSTEM_IO:
#endif //if not (defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
#endif //if not (defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64))
case EFI_ACPI_6_4_FUNCTIONAL_FIXED_HARDWARE:
case EFI_ACPI_6_4_SYSTEM_MEMORY:
return;
@ -142,8 +142,8 @@ STATIC
VOID
EFIAPI
ValidatePccDoorbellGas (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
// For slave subspaces this field is optional, if not present the field
@ -152,7 +152,8 @@ ValidatePccDoorbellGas (
if (IsZeroBuffer (
Ptr,
sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
)) {
))
{
return;
}
}
@ -172,8 +173,8 @@ STATIC
VOID
EFIAPI
ValidatePccIntAckGas (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
// If the subspace does not support interrupts or the interrupt is
@ -183,12 +184,14 @@ ValidatePccIntAckGas (
if (((*PccGlobalFlags & EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=
EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) ||
((*ExtendedPccSubspaceInterruptFlags &
EFI_ACPI_6_4_PCCT_SUBSPACE_PLATFORM_INTERRUPT_FLAGS_MODE) ==
EFI_ACPI_6_4_PCCT_SUBSPACE_PLATFORM_INTERRUPT_FLAGS_MODE)) {
EFI_ACPI_6_4_PCCT_SUBSPACE_PLATFORM_INTERRUPT_FLAGS_MODE) ==
EFI_ACPI_6_4_PCCT_SUBSPACE_PLATFORM_INTERRUPT_FLAGS_MODE))
{
if (IsZeroBuffer (
Ptr,
sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
)) {
))
{
return;
}
}
@ -207,8 +210,8 @@ STATIC
VOID
EFIAPI
ValidatePccErrStatusGas (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
// This field is ignored by the OSPM on slave channels.
@ -230,19 +233,20 @@ STATIC
VOID
EFIAPI
ValidatePlatInterrupt (
IN UINT8* Ptr,
IN VOID* Context
IN UINT8 *Ptr,
IN VOID *Context
)
{
// If a slave subspace is present in the PCCT, then the global Platform
// Interrupt flag must be set to 1.
if ((*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) &&
((*PccGlobalFlags & EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=
EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT)) {
EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT))
{
IncrementErrorCount ();
Print (
L"\nError: Global Platform interrupt flag must be set to 1" \
L" if a PCC type 4 structure is present in PCCT."
L" if a PCC type 4 structure is present in PCCT."
);
}
}
@ -250,17 +254,17 @@ ValidatePlatInterrupt (
/**
An ACPI_PARSER array describing the ACPI PCCT Table.
*/
STATIC CONST ACPI_PARSER PcctParser[] = {
STATIC CONST ACPI_PARSER PcctParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Flags", 4, 36, NULL, NULL, (VOID**)&PccGlobalFlags, NULL, NULL},
{L"Reserved", 8, 40, NULL, NULL, NULL, NULL, NULL}
{ L"Flags", 4, 36, NULL, NULL, (VOID **)&PccGlobalFlags, NULL, NULL },
{ L"Reserved", 8, 40, NULL, NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the platform communications channel subspace
structure header.
*/
STATIC CONST ACPI_PARSER PccSubspaceHeaderParser[] = {
STATIC CONST ACPI_PARSER PccSubspaceHeaderParser[] = {
PCC_SUBSPACE_HEADER ()
// ... Type Specific Fields ...
};
@ -268,126 +272,126 @@ STATIC CONST ACPI_PARSER PccSubspaceHeaderParser[] = {
/**
An ACPI_PARSER array describing the Generic Communications Subspace - Type 0
*/
STATIC CONST ACPI_PARSER PccSubspaceType0Parser[] = {
STATIC CONST ACPI_PARSER PccSubspaceType0Parser[] = {
PCC_SUBSPACE_HEADER (),
{L"Reserved", 6, 2, L"%x %x %x %x %x %x", Dump6Chars, NULL, NULL, NULL},
{L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Memory Range Length", 8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL},
{L"Doorbell Register", 12, 24, NULL, DumpGas, NULL, ValidatePccMemoryIoGas,
NULL},
{L"Doorbell Preserve", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL},
{L"Maximum Periodic Access Rate", 4, 56, L"%u", NULL, NULL, NULL, NULL},
{L"Minimum Request Turnaround Time", 2, 60, L"%u", NULL, NULL, NULL, NULL}
{ L"Reserved", 6, 2, L"%x %x %x %x %x %x", Dump6Chars, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL, ValidatePccMemoryIoGas,
NULL },
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the HW-Reduced Communications Subspace
- Type 1
*/
STATIC CONST ACPI_PARSER PccSubspaceType1Parser[] = {
STATIC CONST ACPI_PARSER PccSubspaceType1Parser[] = {
PCC_SUBSPACE_HEADER (),
{L"Platform Interrupt", 4, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Flags", 1, 6, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL},
{L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Memory Range Length", 8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL},
{L"Doorbell Register", 12, 24, NULL, DumpGas, NULL,
ValidatePccGas, NULL},
{L"Doorbell Preserve", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL},
{L"Maximum Periodic Access Rate", 4, 56, L"%u", NULL, NULL, NULL, NULL},
{L"Minimum Request Turnaround Time", 2, 60, L"%u", NULL, NULL, NULL, NULL}
{ L"Platform Interrupt",4, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Flags",1, 6, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL,
ValidatePccGas, NULL },
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL }
};
/**
An ACPI_PARSER array describing the HW-Reduced Communications Subspace
- Type 2
*/
STATIC CONST ACPI_PARSER PccSubspaceType2Parser[] = {
STATIC CONST ACPI_PARSER PccSubspaceType2Parser[] = {
PCC_SUBSPACE_HEADER (),
{L"Platform Interrupt", 4, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Flags", 1, 6, L"0x%x", NULL, NULL, NULL, NULL},
{L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL},
{L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Memory Range Length", 8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL},
{L"Doorbell Register", 12, 24, NULL, DumpGas, NULL,
ValidatePccGas, NULL},
{L"Doorbell Preserve", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL},
{L"Maximum Periodic Access Rate", 4, 56, L"%u", NULL, NULL, NULL, NULL},
{L"Minimum Request Turnaround Time", 2, 60, L"%u", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Ack Register", 12, 62, NULL, DumpGas, NULL,
ValidatePccGas, NULL},
{L"Platform Interrupt Ack Preserve", 8, 74, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Ack Write", 8, 82, L"0x%lx", NULL, NULL,
NULL, NULL},
{ L"Platform Interrupt",4, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Flags",1, 6, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL,
ValidatePccGas, NULL },
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Ack Register",12, 62, NULL, DumpGas, NULL,
ValidatePccGas, NULL },
{ L"Platform Interrupt Ack Preserve",8, 74, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Ack Write",8, 82, L"0x%lx", NULL, NULL,
NULL, NULL },
};
/**
An ACPI_PARSER array describing the Extended PCC Subspaces - Type 3/4
*/
STATIC CONST ACPI_PARSER PccSubspaceType3Parser[] = {
STATIC CONST ACPI_PARSER PccSubspaceType3Parser[] = {
PCC_SUBSPACE_HEADER (),
{L"Platform Interrupt", 4, 2, L"0x%x", NULL, NULL,
ValidatePlatInterrupt, NULL},
{L"Platform Interrupt Flags", 1, 6, L"0x%x", NULL,
(VOID**)&ExtendedPccSubspaceInterruptFlags, NULL, NULL},
{L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL},
{L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Memory Range Length", 4, 16, L"0x%x", NULL, NULL, ValidateRangeLength4,
NULL},
{L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
ValidatePccDoorbellGas, NULL},
{L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Nominal Latency", 4, 48, L"%u", NULL, NULL, NULL, NULL},
{L"Maximum Periodic Access Rate", 4, 52, L"%u", NULL, NULL, NULL, NULL},
{L"Minimum Request Turnaround Time", 4, 56, L"%u", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Ack Register", 12, 60, NULL, DumpGas, NULL,
ValidatePccIntAckGas, NULL},
{L"Platform Interrupt Ack Preserve", 8, 72, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Platform Interrupt Ack Set", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Reserved", 8, 88, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Cmd Complete Check Reg Addr", 12, 96, NULL, DumpGas, NULL,
ValidatePccGas, NULL},
{L"Cmd Complete Check Mask", 8, 108, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Cmd Update Reg Addr", 12, 116, NULL, DumpGas, NULL,
ValidatePccGas, NULL},
{L"Cmd Update Preserve mask", 8, 128, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Cmd Update Set mask", 8, 136, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Error Status Register", 12, 144, NULL, DumpGas, NULL,
ValidatePccErrStatusGas, NULL},
{L"Error Status Mask", 8, 156, L"0x%lx", NULL, NULL, NULL, NULL},
{ L"Platform Interrupt", 4, 2, L"0x%x", NULL, NULL,
ValidatePlatInterrupt, NULL },
{ L"Platform Interrupt Flags", 1, 6, L"0x%x", NULL,
(VOID **)&ExtendedPccSubspaceInterruptFlags,NULL, NULL },
{ L"Reserved", 1, 7, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Memory Range Length", 4, 16, L"0x%x", NULL, NULL,ValidateRangeLength4,
NULL },
{ L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
ValidatePccDoorbellGas, NULL },
{ L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Nominal Latency", 4, 48, L"%u", NULL, NULL,NULL, NULL },
{ L"Maximum Periodic Access Rate", 4, 52, L"%u", NULL, NULL,NULL, NULL },
{ L"Minimum Request Turnaround Time", 4, 56, L"%u", NULL, NULL,NULL, NULL },
{ L"Platform Interrupt Ack Register", 12, 60, NULL, DumpGas, NULL,
ValidatePccIntAckGas, NULL },
{ L"Platform Interrupt Ack Preserve", 8, 72, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Platform Interrupt Ack Set", 8, 80, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Reserved", 8, 88, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Cmd Complete Check Reg Addr", 12, 96, NULL, DumpGas, NULL,
ValidatePccGas, NULL },
{ L"Cmd Complete Check Mask", 8, 108, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Cmd Update Reg Addr", 12, 116, NULL, DumpGas, NULL,
ValidatePccGas, NULL },
{ L"Cmd Update Preserve mask", 8, 128, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Cmd Update Set mask", 8, 136, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Error Status Register", 12, 144, NULL, DumpGas, NULL,
ValidatePccErrStatusGas, NULL },
{ L"Error Status Mask", 8, 156, L"0x%lx", NULL, NULL,NULL, NULL },
};
/**
An ACPI_PARSER array describing the HW Registers based Communications
Subspace Structure - Type 5
*/
STATIC CONST ACPI_PARSER PccSubspaceType5Parser[] = {
STATIC CONST ACPI_PARSER PccSubspaceType5Parser[] = {
PCC_SUBSPACE_HEADER (),
{L"Version", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
{L"Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Shared Memory Range Length", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas, NULL},
{L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Command Complete Check Register", 12, 48, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas, NULL},
{L"Command Complete Check Mask", 8, 60, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Error Status Register", 12, 68, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas, NULL},
{L"Error Status Mask", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Nominal Latency", 4, 88, L"0x%x", NULL, NULL, NULL, NULL},
{L"Minimum Request Turnaround Time", 4, 92, L"0x%x", NULL, NULL, NULL, NULL}
{ L"Version", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Shared Memory Range Length",8, 12, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas,NULL },
{ L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Command Complete Check Register",12, 48, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas,NULL },
{ L"Command Complete Check Mask",8, 60, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Error Status Register",12, 68, NULL, DumpGas, NULL,
ValidatePccMemoryIoGas,NULL },
{ L"Error Status Mask", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 88, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",4, 92, L"0x%x", NULL, NULL, NULL, NULL }
};
/**
@ -399,7 +403,7 @@ STATIC CONST ACPI_PARSER PccSubspaceType5Parser[] = {
STATIC
VOID
DumpPccSubspaceType0 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -422,7 +426,7 @@ DumpPccSubspaceType0 (
STATIC
VOID
DumpPccSubspaceType1 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -445,7 +449,7 @@ DumpPccSubspaceType1 (
STATIC
VOID
DumpPccSubspaceType2 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -468,7 +472,7 @@ DumpPccSubspaceType2 (
STATIC
VOID
DumpPccSubspaceType3 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -491,7 +495,7 @@ DumpPccSubspaceType3 (
STATIC
VOID
DumpPccSubspaceType4 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -514,7 +518,7 @@ DumpPccSubspaceType4 (
STATIC
VOID
DumpPccSubspaceType5 (
IN UINT8* Ptr,
IN UINT8 *Ptr,
IN UINT8 Length
)
{
@ -544,15 +548,15 @@ DumpPccSubspaceType5 (
VOID
EFIAPI
ParseAcpiPcct (
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* PccSubspacePtr;
UINTN SubspaceCount;
UINT32 Offset;
UINT8 *PccSubspacePtr;
UINTN SubspaceCount;
if (!Trace) {
return;
@ -584,11 +588,12 @@ ParseAcpiPcct (
// Check if the values used to control the parsing logic have been
// successfully read.
if ((PccSubspaceType == NULL) ||
(PccSubspaceLength == NULL)) {
(PccSubspaceLength == NULL))
{
IncrementErrorCount ();
Print (
L"ERROR: Insufficient remaining table buffer length to read the " \
L"structure header. Length = %u.\n",
L"structure header. Length = %u.\n",
AcpiTableLength - Offset
);
return;
@ -596,11 +601,12 @@ ParseAcpiPcct (
// Validate Structure length
if ((*PccSubspaceLength == 0) ||
((Offset + (*PccSubspaceLength)) > AcpiTableLength)) {
((Offset + (*PccSubspaceLength)) > AcpiTableLength))
{
IncrementErrorCount ();
Print (
L"ERROR: Invalid Structure length. " \
L"Length = %u. Offset = %u. AcpiTableLength = %u.\n",
L"Length = %u. Offset = %u. AcpiTableLength = %u.\n",
*PccSubspaceLength,
Offset,
AcpiTableLength
@ -649,14 +655,14 @@ ParseAcpiPcct (
IncrementErrorCount ();
Print (
L"ERROR: Unknown PCC subspace structure:"
L" Type = %u, Length = %u\n",
L" Type = %u, Length = %u\n",
PccSubspaceType,
*PccSubspaceLength
);
}
PccSubspacePtr += *PccSubspaceLength;
Offset += *PccSubspaceLength;
Offset += *PccSubspaceLength;
SubspaceCount++;
} // while

View File

@ -11,17 +11,17 @@
/**
Minimum value for the 'length' field in subspaces of types 0, 1 and 2.
*/
#define MIN_MEMORY_RANGE_LENGTH 8
#define MIN_MEMORY_RANGE_LENGTH 8
/**
Minimum value for the 'length' field in subspaces of types 3 and 4.
*/
#define MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN 16
#define MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN 16
/**
Maximum number of PCC subspaces.
*/
#define MAX_PCC_SUBSPACES 256
#define MAX_PCC_SUBSPACES 256
/**
Parser for the header of any type of PCC subspace.