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:
committed by
mergify[bot]
parent
c411b485b6
commit
47d20b54f9
@ -18,16 +18,16 @@
|
||||
#include "AcpiViewConfig.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC UINT8* AestNodeType;
|
||||
STATIC UINT16* AestNodeLength;
|
||||
STATIC UINT32* NodeDataOffset;
|
||||
STATIC UINT32* NodeInterfaceOffset;
|
||||
STATIC UINT32* NodeInterruptArrayOffset;
|
||||
STATIC UINT32* NodeInterruptCount;
|
||||
STATIC UINT32* ProcessorId;
|
||||
STATIC UINT8* ProcessorFlags;
|
||||
STATIC UINT8* ProcessorResourceType;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC UINT8 *AestNodeType;
|
||||
STATIC UINT16 *AestNodeLength;
|
||||
STATIC UINT32 *NodeDataOffset;
|
||||
STATIC UINT32 *NodeInterfaceOffset;
|
||||
STATIC UINT32 *NodeInterruptArrayOffset;
|
||||
STATIC UINT32 *NodeInterruptCount;
|
||||
STATIC UINT32 *ProcessorId;
|
||||
STATIC UINT8 *ProcessorFlags;
|
||||
STATIC UINT8 *ProcessorResourceType;
|
||||
|
||||
/**
|
||||
Validate Processor Flags.
|
||||
@ -40,16 +40,18 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateProcessorFlags (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
// If the global or shared node flag is set then the ACPI Processor ID
|
||||
// field must be set to 0 and ignored.
|
||||
if (((*Ptr & 0x3) != 0) && (*ProcessorId != 0)) {
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nERROR: 'ACPI Processor ID' field must be set to 0 for global"
|
||||
L" or shared nodes.");
|
||||
Print (
|
||||
L"\nERROR: 'ACPI Processor ID' field must be set to 0 for global"
|
||||
L" or shared nodes."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,13 +66,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateGicInterfaceType (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT32 GicInterfaceType;
|
||||
UINT32 GicInterfaceType;
|
||||
|
||||
GicInterfaceType = *(UINT32*)Ptr;
|
||||
GicInterfaceType = *(UINT32 *)Ptr;
|
||||
if (GicInterfaceType > 3) {
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nError: Invalid GIC Interface type %d", GicInterfaceType);
|
||||
@ -88,8 +90,8 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateInterfaceType (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*Ptr > 1) {
|
||||
@ -109,8 +111,8 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateInterruptType (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*Ptr > 1) {
|
||||
@ -130,8 +132,8 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateInterruptFlags (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if ((*Ptr & 0xfe) != 0) {
|
||||
@ -149,8 +151,8 @@ ValidateInterruptFlags (
|
||||
VOID
|
||||
EFIAPI
|
||||
DumpVendorSpecificData (
|
||||
IN CONST CHAR16* Format OPTIONAL,
|
||||
IN UINT8* Ptr
|
||||
IN CONST CHAR16 *Format OPTIONAL,
|
||||
IN UINT8 *Ptr
|
||||
)
|
||||
{
|
||||
Print (
|
||||
@ -183,27 +185,27 @@ DumpVendorSpecificData (
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI AEST Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestParser[] = {
|
||||
STATIC CONST ACPI_PARSER AestParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo)
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the AEST Node Header.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestNodeHeaderParser[] = {
|
||||
{L"Type", 1, 0, L"%d", NULL, (VOID**)&AestNodeType, NULL, NULL},
|
||||
{L"Length", 2, 1, L"%d", NULL, (VOID**)&AestNodeLength, NULL, NULL},
|
||||
{L"Reserved", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Node Data Offset", 4, 4, L"%d", NULL, (VOID**)&NodeDataOffset, NULL, NULL},
|
||||
{L"Node Interface Offset", 4, 8, L"%d", NULL,
|
||||
(VOID**)&NodeInterfaceOffset, NULL, NULL},
|
||||
{L"Node Interrupt Array Offset", 4, 12, L"%d", NULL,
|
||||
(VOID**)&NodeInterruptArrayOffset, NULL, NULL},
|
||||
{L"Node Interrupt Count", 4, 16, L"%d", NULL,
|
||||
(VOID**)&NodeInterruptCount, NULL, NULL},
|
||||
{L"Timestamp Rate", 8, 20, L"%ld", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved1", 8, 28, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Error Injection Countdown Rate", 8, 36, L"%ld", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestNodeHeaderParser[] = {
|
||||
{ L"Type", 1, 0, L"%d", NULL, (VOID **)&AestNodeType, NULL, NULL },
|
||||
{ L"Length", 2, 1, L"%d", NULL, (VOID **)&AestNodeLength, NULL, NULL },
|
||||
{ L"Reserved", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Node Data Offset", 4, 4, L"%d", NULL, (VOID **)&NodeDataOffset, NULL, NULL },
|
||||
{ L"Node Interface Offset", 4, 8, L"%d", NULL,
|
||||
(VOID **)&NodeInterfaceOffset, NULL, NULL },
|
||||
{ L"Node Interrupt Array Offset", 4, 12, L"%d", NULL,
|
||||
(VOID **)&NodeInterruptArrayOffset, NULL, NULL },
|
||||
{ L"Node Interrupt Count", 4, 16, L"%d", NULL,
|
||||
(VOID **)&NodeInterruptCount, NULL, NULL },
|
||||
{ L"Timestamp Rate", 8, 20, L"%ld", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved1", 8, 28, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Error Injection Countdown Rate", 8, 36, L"%ld", NULL, NULL, NULL, NULL }
|
||||
// Node specific data...
|
||||
// Node interface...
|
||||
// Node interrupt array...
|
||||
@ -212,100 +214,100 @@ STATIC CONST ACPI_PARSER AestNodeHeaderParser[] = {
|
||||
/**
|
||||
An ACPI_PARSER array describing the Processor error node specific data.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestProcessorStructure[] = {
|
||||
{L"ACPI Processor ID", 4, 0, L"0x%x", NULL, (VOID**)&ProcessorId, NULL, NULL},
|
||||
{L"Resource Type", 1, 4, L"%d", NULL, (VOID**)&ProcessorResourceType, NULL,
|
||||
NULL},
|
||||
{L"Reserved", 1, 5, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 1, 6, L"0x%x", NULL, (VOID**)&ProcessorFlags,
|
||||
ValidateProcessorFlags, NULL},
|
||||
{L"Revision", 1, 7, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Processor Affinity Level Indicator", 8, 8, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL},
|
||||
STATIC CONST ACPI_PARSER AestProcessorStructure[] = {
|
||||
{ L"ACPI Processor ID", 4, 0, L"0x%x", NULL, (VOID **)&ProcessorId, NULL, NULL },
|
||||
{ L"Resource Type", 1, 4, L"%d", NULL, (VOID **)&ProcessorResourceType, NULL,
|
||||
NULL },
|
||||
{ L"Reserved", 1, 5, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 1, 6, L"0x%x", NULL, (VOID **)&ProcessorFlags,
|
||||
ValidateProcessorFlags, NULL },
|
||||
{ L"Revision", 1, 7, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Processor Affinity Level Indicator", 8, 8, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL },
|
||||
// Resource specific data...
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the processor cache resource substructure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestProcessorCacheResourceSubstructure[] = {
|
||||
{L"Cache reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 4, 4, L"%d", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestProcessorCacheResourceSubstructure[] = {
|
||||
{ L"Cache reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 4, 4, L"%d", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the processor TLB resource substructure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestProcessorTlbResourceSubstructure[] = {
|
||||
{L"TLB reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 4, 4, L"%d", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestProcessorTlbResourceSubstructure[] = {
|
||||
{ L"TLB reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 4, 4, L"%d", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the processor generic resource substructure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestProcessorGenericResourceSubstructure[] = {
|
||||
{L"Vendor-defined data", 4, 0, L"%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestProcessorGenericResourceSubstructure[] = {
|
||||
{ L"Vendor-defined data", 4, 0, L"%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the memory controller structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestMemoryControllerStructure[] = {
|
||||
{L"Proximity Domain", 4, 0, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestMemoryControllerStructure[] = {
|
||||
{ L"Proximity Domain", 4, 0, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the SMMU structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestSmmuStructure[] = {
|
||||
{L"IORT Node reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SubComponent reference ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestSmmuStructure[] = {
|
||||
{ L"IORT Node reference ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SubComponent reference ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the vendor-defined structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestVendorDefinedStructure[] = {
|
||||
{L"Hardware ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Unique ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Vendor-specific data", 16, 8, NULL, DumpVendorSpecificData, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestVendorDefinedStructure[] = {
|
||||
{ L"Hardware ID", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Unique ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Vendor-specific data", 16, 8, NULL, DumpVendorSpecificData, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GIC structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestGicStructure[] = {
|
||||
{L"GIC Interface Type", 4, 0, L"0x%x", NULL, NULL, ValidateGicInterfaceType,
|
||||
NULL},
|
||||
{L"GIC Interface reference ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestGicStructure[] = {
|
||||
{ L"GIC Interface Type", 4, 0, L"0x%x", NULL, NULL, ValidateGicInterfaceType,
|
||||
NULL },
|
||||
{ L"GIC Interface reference ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the node interface.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestNodeInterface[] = {
|
||||
{L"Interface Type", 1, 0, L"%d", NULL, NULL, ValidateInterfaceType, NULL},
|
||||
{L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Start Error Record Index", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Number of Error Records", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Error Records Implemented", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Error Records Support", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Addressing mode", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestNodeInterface[] = {
|
||||
{ L"Interface Type", 1, 0, L"%d", NULL, NULL, ValidateInterfaceType, NULL },
|
||||
{ L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Start Error Record Index", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Number of Error Records", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Error Records Implemented", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Error Records Support", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Addressing mode", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the node interrupts.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER AestNodeInterrupt[] = {
|
||||
{L"Interrupt Type", 1, 0, L"%d", NULL, NULL, ValidateInterruptType, NULL},
|
||||
{L"Reserved", 2, 1, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Interrupt Flags", 1, 3, L"0x%x", NULL, NULL, ValidateInterruptFlags, NULL},
|
||||
{L"Interrupt GSIV", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ID", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved1", 3, 9, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER AestNodeInterrupt[] = {
|
||||
{ L"Interrupt Type", 1, 0, L"%d", NULL, NULL, ValidateInterruptType, NULL },
|
||||
{ L"Reserved", 2, 1, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Interrupt Flags", 1, 3, L"0x%x", NULL, NULL, ValidateInterruptFlags, NULL },
|
||||
{ L"Interrupt GSIV", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ID", 1, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved1", 3, 9, L"%x %x %x", Dump3Chars, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -318,11 +320,11 @@ STATIC CONST ACPI_PARSER AestNodeInterrupt[] = {
|
||||
STATIC
|
||||
VOID
|
||||
DumpProcessorNode (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 Offset;
|
||||
|
||||
Offset = ParseAcpi (
|
||||
TRUE,
|
||||
@ -337,7 +339,8 @@ DumpProcessorNode (
|
||||
// successfully read.
|
||||
if ((ProcessorId == NULL) ||
|
||||
(ProcessorResourceType == NULL) ||
|
||||
(ProcessorFlags == NULL)) {
|
||||
(ProcessorFlags == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient Processor Error Node length. Length = %d.\n",
|
||||
@ -393,8 +396,8 @@ DumpProcessorNode (
|
||||
STATIC
|
||||
VOID
|
||||
DumpMemoryControllerNode (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -416,8 +419,8 @@ DumpMemoryControllerNode (
|
||||
STATIC
|
||||
VOID
|
||||
DumpSmmuNode (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -439,8 +442,8 @@ DumpSmmuNode (
|
||||
STATIC
|
||||
VOID
|
||||
DumpVendorDefinedNode (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -462,8 +465,8 @@ DumpVendorDefinedNode (
|
||||
STATIC
|
||||
VOID
|
||||
DumpGicNode (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -485,8 +488,8 @@ DumpGicNode (
|
||||
STATIC
|
||||
VOID
|
||||
DumpNodeInterface (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -509,19 +512,19 @@ DumpNodeInterface (
|
||||
STATIC
|
||||
VOID
|
||||
DumpNodeInterrupts (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length,
|
||||
IN UINT32 InterruptCount
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length,
|
||||
IN UINT32 InterruptCount
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR8 Buffer[64];
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR8 Buffer[64];
|
||||
|
||||
if (Length < (InterruptCount * sizeof (EFI_ACPI_AEST_INTERRUPT_STRUCT))) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Node not long enough for Interrupt Array.\n"\
|
||||
L"ERROR: Node not long enough for Interrupt Array.\n" \
|
||||
L" Length left = %d, Required = %d, Interrupt Count = %d\n",
|
||||
Length,
|
||||
(InterruptCount * sizeof (EFI_ACPI_AEST_INTERRUPT_STRUCT)),
|
||||
@ -547,7 +550,7 @@ DumpNodeInterrupts (
|
||||
Length - Offset,
|
||||
PARSER_PARAMS (AestNodeInterrupt)
|
||||
);
|
||||
} //for
|
||||
} // for
|
||||
}
|
||||
|
||||
/**
|
||||
@ -564,7 +567,7 @@ DumpNodeInterrupts (
|
||||
STATIC
|
||||
VOID
|
||||
DumpAestNodeStructure (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length,
|
||||
IN UINT8 NodeType,
|
||||
IN UINT32 DataOffset,
|
||||
@ -573,9 +576,9 @@ DumpAestNodeStructure (
|
||||
IN UINT32 InterruptCount
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 RemainingLength;
|
||||
UINT8* NodeDataPtr;
|
||||
UINT32 Offset;
|
||||
UINT32 RemainingLength;
|
||||
UINT8 *NodeDataPtr;
|
||||
|
||||
Offset = ParseAcpi (
|
||||
TRUE,
|
||||
@ -589,7 +592,7 @@ DumpAestNodeStructure (
|
||||
if ((Offset > DataOffset) || (DataOffset > Length)) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Node Data Offset: %d.\n"\
|
||||
L"ERROR: Invalid Node Data Offset: %d.\n" \
|
||||
L" It should be between %d and %d.\n",
|
||||
DataOffset,
|
||||
Offset,
|
||||
@ -600,7 +603,7 @@ DumpAestNodeStructure (
|
||||
if ((Offset > InterfaceOffset) || (InterfaceOffset > Length)) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Node Interface Offset: %d.\n"\
|
||||
L"ERROR: Invalid Node Interface Offset: %d.\n" \
|
||||
L" It should be between %d and %d.\n",
|
||||
InterfaceOffset,
|
||||
Offset,
|
||||
@ -611,7 +614,7 @@ DumpAestNodeStructure (
|
||||
if ((Offset > InterruptArrayOffset) || (InterruptArrayOffset > Length)) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Node Interrupt Array Offset: %d.\n"\
|
||||
L"ERROR: Invalid Node Interrupt Array Offset: %d.\n" \
|
||||
L" It should be between %d and %d.\n",
|
||||
InterruptArrayOffset,
|
||||
Offset,
|
||||
@ -620,7 +623,7 @@ DumpAestNodeStructure (
|
||||
}
|
||||
|
||||
// Parse Node Data Field.
|
||||
NodeDataPtr = Ptr + DataOffset;
|
||||
NodeDataPtr = Ptr + DataOffset;
|
||||
RemainingLength = Length - DataOffset;
|
||||
switch (NodeType) {
|
||||
case EFI_ACPI_AEST_NODE_TYPE_PROCESSOR:
|
||||
@ -675,14 +678,14 @@ DumpAestNodeStructure (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiAest (
|
||||
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* NodePtr;
|
||||
UINT8 *NodePtr;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -716,10 +719,11 @@ ParseAcpiAest (
|
||||
(NodeDataOffset == NULL) ||
|
||||
(NodeInterfaceOffset == NULL) ||
|
||||
(NodeInterruptArrayOffset == NULL) ||
|
||||
(NodeInterruptCount == NULL)) {
|
||||
(NodeInterruptCount == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient length left for Node Structure.\n"\
|
||||
L"ERROR: Insufficient length left for Node Structure.\n" \
|
||||
L" Length left = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
@ -728,11 +732,12 @@ ParseAcpiAest (
|
||||
|
||||
// Validate AEST Node length
|
||||
if ((*AestNodeLength == 0) ||
|
||||
((Offset + (*AestNodeLength)) > AcpiTableLength)) {
|
||||
((Offset + (*AestNodeLength)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid AEST Node length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*AestNodeLength,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
|
@ -14,19 +14,19 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI BDRT Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER BgrtParser[] = {
|
||||
STATIC CONST ACPI_PARSER BgrtParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL}
|
||||
{ L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -44,10 +44,10 @@ STATIC CONST ACPI_PARSER BgrtParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiBgrt (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (!Trace) {
|
||||
|
@ -14,17 +14,17 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local variables pointing to the table fields
|
||||
STATIC CONST UINT32* OffsetDbgDeviceInfo;
|
||||
STATIC CONST UINT32* NumberDbgDeviceInfo;
|
||||
STATIC CONST UINT16* DbgDevInfoLen;
|
||||
STATIC CONST UINT8* GasCount;
|
||||
STATIC CONST UINT16* NameSpaceStringLength;
|
||||
STATIC CONST UINT16* NameSpaceStringOffset;
|
||||
STATIC CONST UINT16* OEMDataLength;
|
||||
STATIC CONST UINT16* OEMDataOffset;
|
||||
STATIC CONST UINT16* BaseAddrRegOffset;
|
||||
STATIC CONST UINT16* AddrSizeOffset;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT32 *OffsetDbgDeviceInfo;
|
||||
STATIC CONST UINT32 *NumberDbgDeviceInfo;
|
||||
STATIC CONST UINT16 *DbgDevInfoLen;
|
||||
STATIC CONST UINT8 *GasCount;
|
||||
STATIC CONST UINT16 *NameSpaceStringLength;
|
||||
STATIC CONST UINT16 *NameSpaceStringOffset;
|
||||
STATIC CONST UINT16 *OEMDataLength;
|
||||
STATIC CONST UINT16 *OEMDataOffset;
|
||||
STATIC CONST UINT16 *BaseAddrRegOffset;
|
||||
STATIC CONST UINT16 *AddrSizeOffset;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
This function validates the NameSpace string length.
|
||||
@ -37,64 +37,64 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateNameSpaceStrLen (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT16 NameSpaceStrLen;
|
||||
UINT16 NameSpaceStrLen;
|
||||
|
||||
NameSpaceStrLen = *(UINT16*)Ptr;
|
||||
NameSpaceStrLen = *(UINT16 *)Ptr;
|
||||
|
||||
if (NameSpaceStrLen < 2) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: NamespaceString Length = %d. If no Namespace device exists, " \
|
||||
L"NamespaceString[] must contain a period '.'",
|
||||
L"NamespaceString[] must contain a period '.'",
|
||||
NameSpaceStrLen
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// An ACPI_PARSER array describing the ACPI DBG2 table.
|
||||
STATIC CONST ACPI_PARSER Dbg2Parser[] = {
|
||||
STATIC CONST ACPI_PARSER Dbg2Parser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"OffsetDbgDeviceInfo", 4, 36, L"0x%x", NULL,
|
||||
(VOID**)&OffsetDbgDeviceInfo, NULL, NULL},
|
||||
{L"NumberDbgDeviceInfo", 4, 40, L"%d", NULL,
|
||||
(VOID**)&NumberDbgDeviceInfo, NULL, NULL}
|
||||
{ L"OffsetDbgDeviceInfo", 4, 36, L"0x%x", NULL,
|
||||
(VOID **)&OffsetDbgDeviceInfo, NULL, NULL },
|
||||
{ L"NumberDbgDeviceInfo", 4, 40, L"%d", NULL,
|
||||
(VOID **)&NumberDbgDeviceInfo, NULL, NULL }
|
||||
};
|
||||
|
||||
/// An ACPI_PARSER array describing the debug device information structure
|
||||
/// header.
|
||||
STATIC CONST ACPI_PARSER DbgDevInfoHeaderParser[] = {
|
||||
{L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 2, 1, L"%d", NULL, (VOID**)&DbgDevInfoLen, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER DbgDevInfoHeaderParser[] = {
|
||||
{ L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 2, 1, L"%d", NULL, (VOID **)&DbgDevInfoLen, NULL, NULL }
|
||||
};
|
||||
|
||||
/// An ACPI_PARSER array describing the debug device information.
|
||||
STATIC CONST ACPI_PARSER DbgDevInfoParser[] = {
|
||||
{L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER DbgDevInfoParser[] = {
|
||||
{ L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Generic Address Registers Count", 1, 3, L"0x%x", NULL,
|
||||
(VOID**)&GasCount, NULL, NULL},
|
||||
{L"NameSpace String Length", 2, 4, L"%d", NULL,
|
||||
(VOID**)&NameSpaceStringLength, ValidateNameSpaceStrLen, NULL},
|
||||
{L"NameSpace String Offset", 2, 6, L"0x%x", NULL,
|
||||
(VOID**)&NameSpaceStringOffset, NULL, NULL},
|
||||
{L"OEM Data Length", 2, 8, L"%d", NULL, (VOID**)&OEMDataLength,
|
||||
NULL, NULL},
|
||||
{L"OEM Data Offset", 2, 10, L"0x%x", NULL, (VOID**)&OEMDataOffset,
|
||||
NULL, NULL},
|
||||
{ L"Generic Address Registers Count", 1, 3, L"0x%x", NULL,
|
||||
(VOID **)&GasCount, NULL, NULL },
|
||||
{ L"NameSpace String Length", 2, 4, L"%d", NULL,
|
||||
(VOID **)&NameSpaceStringLength, ValidateNameSpaceStrLen, NULL },
|
||||
{ L"NameSpace String Offset", 2, 6, L"0x%x", NULL,
|
||||
(VOID **)&NameSpaceStringOffset, NULL, NULL },
|
||||
{ L"OEM Data Length", 2, 8, L"%d", NULL, (VOID **)&OEMDataLength,
|
||||
NULL, NULL },
|
||||
{ L"OEM Data Offset", 2, 10, L"0x%x", NULL, (VOID **)&OEMDataOffset,
|
||||
NULL, NULL },
|
||||
|
||||
{L"Port Type", 2, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Port SubType", 2, 14, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 16, L"%x", NULL, NULL, NULL, NULL},
|
||||
{ L"Port Type", 2, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Port SubType", 2, 14, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 16, L"%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Base Address Register Offset", 2, 18, L"0x%x", NULL,
|
||||
(VOID**)&BaseAddrRegOffset, NULL, NULL},
|
||||
{L"Address Size Offset", 2, 20, L"0x%x", NULL,
|
||||
(VOID**)&AddrSizeOffset, NULL, NULL}
|
||||
{ L"Base Address Register Offset", 2, 18, L"0x%x", NULL,
|
||||
(VOID **)&BaseAddrRegOffset, NULL, NULL },
|
||||
{ L"Address Size Offset", 2, 20, L"0x%x", NULL,
|
||||
(VOID **)&AddrSizeOffset, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -107,8 +107,8 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
DumpDbgDeviceInfo (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length
|
||||
)
|
||||
{
|
||||
UINT16 Index;
|
||||
@ -131,21 +131,23 @@ DumpDbgDeviceInfo (
|
||||
(OEMDataLength == NULL) ||
|
||||
(OEMDataOffset == NULL) ||
|
||||
(BaseAddrRegOffset == NULL) ||
|
||||
(AddrSizeOffset == NULL)) {
|
||||
(AddrSizeOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient Debug Device Information Structure length. " \
|
||||
L"Length = %d.\n",
|
||||
L"Length = %d.\n",
|
||||
Length
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// GAS
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
Offset = *BaseAddrRegOffset;
|
||||
while ((Index++ < *GasCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
PrintFieldName (4, L"BaseAddressRegister");
|
||||
Offset += (UINT16)DumpGasStruct (
|
||||
Ptr + Offset,
|
||||
@ -160,7 +162,7 @@ DumpDbgDeviceInfo (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid GAS count. GasCount = %d. RemainingBufferLength = %d. " \
|
||||
L"Parsing of the Debug Device Information structure aborted.\n",
|
||||
L"Parsing of the Debug Device Information structure aborted.\n",
|
||||
*GasCount,
|
||||
Length - *AddrSizeOffset
|
||||
);
|
||||
@ -168,39 +170,45 @@ DumpDbgDeviceInfo (
|
||||
}
|
||||
|
||||
// Address Size
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
Offset = *AddrSizeOffset;
|
||||
while ((Index++ < *GasCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
PrintFieldName (4, L"Address Size");
|
||||
Print (L"0x%x\n", *((UINT32*)(Ptr + Offset)));
|
||||
Print (L"0x%x\n", *((UINT32 *)(Ptr + Offset)));
|
||||
Offset += sizeof (UINT32);
|
||||
}
|
||||
|
||||
// NameSpace String
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
Offset = *NameSpaceStringOffset;
|
||||
PrintFieldName (4, L"NameSpace String");
|
||||
while ((Index++ < *NameSpaceStringLength) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
Print (L"%c", *(Ptr + Offset));
|
||||
Offset++;
|
||||
}
|
||||
|
||||
Print (L"\n");
|
||||
|
||||
// OEM Data
|
||||
if (*OEMDataOffset != 0) {
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
Offset = *OEMDataOffset;
|
||||
PrintFieldName (4, L"OEM Data");
|
||||
while ((Index++ < *OEMDataLength) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
Print (L"%x ", *(Ptr + Offset));
|
||||
if ((Index & 7) == 0) {
|
||||
Print (L"\n%-*s ", OUTPUT_FIELD_COLUMN_WIDTH, L"");
|
||||
}
|
||||
|
||||
Offset++;
|
||||
}
|
||||
|
||||
Print (L"\n");
|
||||
}
|
||||
}
|
||||
@ -220,14 +228,14 @@ DumpDbgDeviceInfo (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiDbg2 (
|
||||
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;
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -245,7 +253,8 @@ ParseAcpiDbg2 (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((OffsetDbgDeviceInfo == NULL) ||
|
||||
(NumberDbgDeviceInfo == NULL)) {
|
||||
(NumberDbgDeviceInfo == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient table length. AcpiTableLength = %d\n",
|
||||
@ -255,10 +264,9 @@ ParseAcpiDbg2 (
|
||||
}
|
||||
|
||||
Offset = *OffsetDbgDeviceInfo;
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
while (Index++ < *NumberDbgDeviceInfo) {
|
||||
|
||||
// Parse the Debug Device Information Structure header to obtain Length
|
||||
ParseAcpi (
|
||||
FALSE,
|
||||
@ -275,8 +283,8 @@ ParseAcpiDbg2 (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient remaining table buffer length to read the " \
|
||||
L"Debug Device Information structure's 'Length' field. " \
|
||||
L"RemainingTableBufferLength = %d.\n",
|
||||
L"Debug Device Information structure's 'Length' field. " \
|
||||
L"RemainingTableBufferLength = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
return;
|
||||
@ -284,11 +292,12 @@ ParseAcpiDbg2 (
|
||||
|
||||
// Validate Debug Device Information Structure length
|
||||
if ((*DbgDevInfoLen == 0) ||
|
||||
((Offset + (*DbgDevInfoLen)) > AcpiTableLength)) {
|
||||
((Offset + (*DbgDevInfoLen)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Debug Device Information Structure length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*DbgDevInfoLen,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
|
@ -28,10 +28,10 @@
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiDsdt (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (!Trace) {
|
||||
|
@ -16,23 +16,23 @@
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI FACS Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER FacsParser[] = {
|
||||
{L"Signature", 4, 0, L"%c%c%c%c", Dump4Chars, NULL, NULL, NULL},
|
||||
{L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Hardware Signature", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Firmware Waking Vector", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Global Lock", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"X Firmware Walking Vector", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Version", 1, 32, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},
|
||||
{L"OSPM Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 8, 40, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL},
|
||||
{L"Reserved", 8, 48, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL},
|
||||
{L"Reserved", 8, 56, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL}
|
||||
STATIC CONST ACPI_PARSER FacsParser[] = {
|
||||
{ L"Signature", 4, 0, L"%c%c%c%c", Dump4Chars, NULL, NULL, NULL },
|
||||
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Hardware Signature", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Firmware Waking Vector", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Global Lock", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"X Firmware Walking Vector", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Version", 1, 32, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
|
||||
{ L"OSPM Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 8, 40, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Reserved", 8, 48, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Reserved", 8, 56, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,
|
||||
NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -50,10 +50,10 @@ STATIC CONST ACPI_PARSER FacsParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiFacs (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (!Trace) {
|
||||
|
@ -15,33 +15,33 @@
|
||||
#include "AcpiView.h"
|
||||
|
||||
// Local variables
|
||||
STATIC CONST UINT32* DsdtAddress;
|
||||
STATIC CONST UINT64* X_DsdtAddress;
|
||||
STATIC CONST UINT32* Flags;
|
||||
STATIC CONST UINT32* FirmwareCtrl;
|
||||
STATIC CONST UINT64* X_FirmwareCtrl;
|
||||
STATIC CONST UINT8* FadtMinorRevision;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT32 *DsdtAddress;
|
||||
STATIC CONST UINT64 *X_DsdtAddress;
|
||||
STATIC CONST UINT32 *Flags;
|
||||
STATIC CONST UINT32 *FirmwareCtrl;
|
||||
STATIC CONST UINT64 *X_FirmwareCtrl;
|
||||
STATIC CONST UINT8 *FadtMinorRevision;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
A macro defining the Hardware reduced ACPI flag
|
||||
**/
|
||||
#define HW_REDUCED_ACPI BIT20
|
||||
#define HW_REDUCED_ACPI BIT20
|
||||
|
||||
/**
|
||||
Offset to the FACS signature from the start of the FACS.
|
||||
**/
|
||||
#define FACS_SIGNATURE_OFFSET 0
|
||||
#define FACS_SIGNATURE_OFFSET 0
|
||||
|
||||
/**
|
||||
Offset to the FACS revision from the start of the FACS.
|
||||
**/
|
||||
#define FACS_VERSION_OFFSET 32
|
||||
#define FACS_VERSION_OFFSET 32
|
||||
|
||||
/**
|
||||
Offset to the FACS length from the start of the FACS.
|
||||
**/
|
||||
#define FACS_LENGTH_OFFSET 4
|
||||
#define FACS_LENGTH_OFFSET 4
|
||||
|
||||
/**
|
||||
Get the ACPI XSDT header info.
|
||||
@ -63,18 +63,19 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateFirmwareCtrl (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
)
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (*(UINT32*)Ptr != 0) {
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (*(UINT32 *)Ptr != 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: Firmware Control must be zero for ARM platforms."
|
||||
);
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,18 +89,19 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateXFirmwareCtrl (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
)
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (*(UINT64*)Ptr != 0) {
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (*(UINT64 *)Ptr != 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: X Firmware Control must be zero for ARM platforms."
|
||||
);
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,83 +115,84 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateFlags (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
)
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) == 0) {
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (((*(UINT32 *)Ptr) & HW_REDUCED_ACPI) == 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms."
|
||||
);
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI FADT Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER FadtParser[] = {
|
||||
STATIC CONST ACPI_PARSER FadtParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, (VOID**)&FirmwareCtrl,
|
||||
ValidateFirmwareCtrl, NULL},
|
||||
{L"DSDT", 4, 40, L"0x%x", NULL, (VOID**)&DsdtAddress, NULL, NULL},
|
||||
{L"Reserved", 1, 44, L"%x", NULL, NULL, NULL, NULL},
|
||||
{L"Preferred_PM_Profile", 1, 45, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SCI_INT", 2, 46, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SMI_CMD", 4, 48, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ACPI_ENABLE", 1, 52, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ACPI_DISABLE", 1, 53, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"S4BIOS_REQ", 1, 54, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PSTATE_CNT", 1, 55, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1a_EVT_BLK", 4, 56, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1b_EVT_BLK", 4, 60, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1a_CNT_BLK", 4, 64, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1b_CNT_BLK", 4, 68, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM2_CNT_BLK", 4, 72, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM_TMR_BLK", 4, 76, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GPE0_BLK", 4, 80, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GPE1_BLK", 4, 84, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1_EVT_LEN", 1, 88, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM1_CNT_LEN", 1, 89, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM2_CNT_LEN", 1, 90, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PM_TMR_LEN", 1, 91, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GPE0_BLK_LEN", 1, 92, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GPE1_BLK_LEN", 1, 93, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GPE1_BASE", 1, 94, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"CST_CNT", 1, 95, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"P_LVL2_LAT", 2, 96, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"P_LVL3_LAT", 2, 98, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"FLUSH_SIZE", 2, 100, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"FLUSH_STRIDE", 2, 102, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"DUTY_OFFSET", 1, 104, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"DUTY_WIDTH", 1, 105, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"DAY_ALRM", 1, 106, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"MON_ALRM", 1, 107, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"CENTURY", 1, 108, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"IAPC_BOOT_ARCH", 2, 109, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 1, 111, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 112, L"0x%x", NULL, (VOID**)&Flags, ValidateFlags, NULL},
|
||||
{L"RESET_REG", 12, 116, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"RESET_VALUE", 1, 128, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ARM_BOOT_ARCH", 2, 129, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"FADT Minor Version", 1, 131, L"0x%x", NULL, (VOID**)&FadtMinorRevision,
|
||||
NULL, NULL},
|
||||
{L"X_FIRMWARE_CTRL", 8, 132, L"0x%lx", NULL, (VOID**)&X_FirmwareCtrl,
|
||||
ValidateXFirmwareCtrl, NULL},
|
||||
{L"X_DSDT", 8, 140, L"0x%lx", NULL, (VOID**)&X_DsdtAddress, NULL, NULL},
|
||||
{L"X_PM1a_EVT_BLK", 12, 148, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_PM1b_EVT_BLK", 12, 160, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_PM1a_CNT_BLK", 12, 172, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_PM1b_CNT_BLK", 12, 184, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_PM2_CNT_BLK", 12, 196, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_PM_TMR_BLK", 12, 208, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_GPE0_BLK", 12, 220, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"X_GPE1_BLK", 12, 232, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"SLEEP_CONTROL_REG", 12, 244, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"SLEEP_STATUS_REG", 12, 256, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL}
|
||||
{ L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, (VOID **)&FirmwareCtrl,
|
||||
ValidateFirmwareCtrl, NULL },
|
||||
{ L"DSDT", 4, 40, L"0x%x", NULL, (VOID **)&DsdtAddress, NULL, NULL },
|
||||
{ L"Reserved", 1, 44, L"%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Preferred_PM_Profile", 1, 45, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SCI_INT", 2, 46, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SMI_CMD", 4, 48, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ACPI_ENABLE", 1, 52, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ACPI_DISABLE", 1, 53, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"S4BIOS_REQ", 1, 54, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PSTATE_CNT", 1, 55, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1a_EVT_BLK", 4, 56, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1b_EVT_BLK", 4, 60, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1a_CNT_BLK", 4, 64, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1b_CNT_BLK", 4, 68, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM2_CNT_BLK", 4, 72, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM_TMR_BLK", 4, 76, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GPE0_BLK", 4, 80, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GPE1_BLK", 4, 84, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1_EVT_LEN", 1, 88, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM1_CNT_LEN", 1, 89, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM2_CNT_LEN", 1, 90, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PM_TMR_LEN", 1, 91, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GPE0_BLK_LEN", 1, 92, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GPE1_BLK_LEN", 1, 93, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GPE1_BASE", 1, 94, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"CST_CNT", 1, 95, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"P_LVL2_LAT", 2, 96, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"P_LVL3_LAT", 2, 98, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"FLUSH_SIZE", 2, 100, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"FLUSH_STRIDE", 2, 102, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"DUTY_OFFSET", 1, 104, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"DUTY_WIDTH", 1, 105, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"DAY_ALRM", 1, 106, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"MON_ALRM", 1, 107, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"CENTURY", 1, 108, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"IAPC_BOOT_ARCH", 2, 109, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 1, 111, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 112, L"0x%x", NULL, (VOID **)&Flags, ValidateFlags, NULL },
|
||||
{ L"RESET_REG", 12, 116, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"RESET_VALUE", 1, 128, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ARM_BOOT_ARCH", 2, 129, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"FADT Minor Version", 1, 131, L"0x%x", NULL, (VOID **)&FadtMinorRevision,
|
||||
NULL, NULL },
|
||||
{ L"X_FIRMWARE_CTRL", 8, 132, L"0x%lx", NULL, (VOID **)&X_FirmwareCtrl,
|
||||
ValidateXFirmwareCtrl, NULL },
|
||||
{ L"X_DSDT", 8, 140, L"0x%lx", NULL, (VOID **)&X_DsdtAddress, NULL, NULL },
|
||||
{ L"X_PM1a_EVT_BLK", 12, 148, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_PM1b_EVT_BLK", 12, 160, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_PM1a_CNT_BLK", 12, 172, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_PM1b_CNT_BLK", 12, 184, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_PM2_CNT_BLK", 12, 196, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_PM_TMR_BLK", 12, 208, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_GPE0_BLK", 12, 220, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"X_GPE1_BLK", 12, 232, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"SLEEP_CONTROL_REG", 12, 244, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"SLEEP_STATUS_REG", 12, 256, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -206,19 +209,19 @@ STATIC CONST ACPI_PARSER FadtParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiFadt (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8* DsdtPtr;
|
||||
UINT8* FirmwareCtrlPtr;
|
||||
UINT32 FacsSignature;
|
||||
UINT32 FacsLength;
|
||||
UINT8 FacsRevision;
|
||||
PARSE_ACPI_TABLE_PROC FacsParserProc;
|
||||
EFI_STATUS Status;
|
||||
UINT8 *DsdtPtr;
|
||||
UINT8 *FirmwareCtrlPtr;
|
||||
UINT32 FacsSignature;
|
||||
UINT32 FacsLength;
|
||||
UINT8 FacsRevision;
|
||||
PARSE_ACPI_TABLE_PROC FacsParserProc;
|
||||
|
||||
ParseAcpi (
|
||||
Trace,
|
||||
@ -233,7 +236,7 @@ ParseAcpiFadt (
|
||||
if (FadtMinorRevision != NULL) {
|
||||
Print (L"\nSummary:\n");
|
||||
PrintFieldName (2, L"FADT Version");
|
||||
Print (L"%d.%d\n", *AcpiHdrInfo.Revision, *FadtMinorRevision);
|
||||
Print (L"%d.%d\n", *AcpiHdrInfo.Revision, *FadtMinorRevision);
|
||||
}
|
||||
|
||||
if (*GetAcpiXsdtHeaderInfo ()->OemTableId != *AcpiHdrInfo.OemTableId) {
|
||||
@ -245,9 +248,9 @@ ParseAcpiFadt (
|
||||
// If X_FIRMWARE_CTRL is not zero then use X_FIRMWARE_CTRL and ignore
|
||||
// FIRMWARE_CTRL, else use FIRMWARE_CTRL.
|
||||
if ((X_FirmwareCtrl != NULL) && (*X_FirmwareCtrl != 0)) {
|
||||
FirmwareCtrlPtr = (UINT8*)(UINTN)(*X_FirmwareCtrl);
|
||||
FirmwareCtrlPtr = (UINT8 *)(UINTN)(*X_FirmwareCtrl);
|
||||
} else if ((FirmwareCtrl != NULL) && (*FirmwareCtrl != 0)) {
|
||||
FirmwareCtrlPtr = (UINT8*)(UINTN)(*FirmwareCtrl);
|
||||
FirmwareCtrlPtr = (UINT8 *)(UINTN)(*FirmwareCtrl);
|
||||
} else {
|
||||
FirmwareCtrlPtr = NULL;
|
||||
// if HW_REDUCED_ACPI flag is not set, both FIRMWARE_CTRL and
|
||||
@ -255,10 +258,13 @@ ParseAcpiFadt (
|
||||
// present.
|
||||
if ((Trace) &&
|
||||
(Flags != NULL) &&
|
||||
((*Flags & EFI_ACPI_6_3_HW_REDUCED_ACPI) != EFI_ACPI_6_3_HW_REDUCED_ACPI)) {
|
||||
((*Flags & EFI_ACPI_6_3_HW_REDUCED_ACPI) != EFI_ACPI_6_3_HW_REDUCED_ACPI))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (L"ERROR: No FACS table found, "
|
||||
L"both X_FIRMWARE_CTRL and FIRMWARE_CTRL are zero.\n");
|
||||
Print (
|
||||
L"ERROR: No FACS table found, "
|
||||
L"both X_FIRMWARE_CTRL and FIRMWARE_CTRL are zero.\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,13 +272,13 @@ ParseAcpiFadt (
|
||||
// The FACS table does not have a standard ACPI table header. Therefore,
|
||||
// the signature, length and version needs to be initially parsed.
|
||||
// The FACS signature is 4 bytes starting at offset 0.
|
||||
FacsSignature = *(UINT32*)(FirmwareCtrlPtr + FACS_SIGNATURE_OFFSET);
|
||||
FacsSignature = *(UINT32 *)(FirmwareCtrlPtr + FACS_SIGNATURE_OFFSET);
|
||||
|
||||
// The FACS length is 4 bytes starting at offset 4.
|
||||
FacsLength = *(UINT32*)(FirmwareCtrlPtr + FACS_LENGTH_OFFSET);
|
||||
FacsLength = *(UINT32 *)(FirmwareCtrlPtr + FACS_LENGTH_OFFSET);
|
||||
|
||||
// The FACS version is 1 byte starting at offset 32.
|
||||
FacsRevision = *(UINT8*)(FirmwareCtrlPtr + FACS_VERSION_OFFSET);
|
||||
FacsRevision = *(UINT8 *)(FirmwareCtrlPtr + FACS_VERSION_OFFSET);
|
||||
|
||||
Trace = ProcessTableReportOptions (
|
||||
FacsSignature,
|
||||
@ -298,12 +304,12 @@ ParseAcpiFadt (
|
||||
|
||||
// If X_DSDT is valid then use X_DSDT and ignore DSDT, else use DSDT.
|
||||
if ((X_DsdtAddress != NULL) && (*X_DsdtAddress != 0)) {
|
||||
DsdtPtr = (UINT8*)(UINTN)(*X_DsdtAddress);
|
||||
DsdtPtr = (UINT8 *)(UINTN)(*X_DsdtAddress);
|
||||
} else if ((DsdtAddress != NULL) && (*DsdtAddress != 0)) {
|
||||
DsdtPtr = (UINT8*)(UINTN)(*DsdtAddress);
|
||||
DsdtPtr = (UINT8 *)(UINTN)(*DsdtAddress);
|
||||
} else {
|
||||
// Both DSDT and X_DSDT cannot be invalid.
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (Trace) {
|
||||
// The DSDT Table is mandatory for ARM systems
|
||||
// as the CPU information MUST be presented in
|
||||
@ -311,7 +317,8 @@ ParseAcpiFadt (
|
||||
IncrementErrorCount ();
|
||||
Print (L"ERROR: Both X_DSDT and DSDT are invalid.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -15,16 +15,16 @@
|
||||
#include "AcpiViewConfig.h"
|
||||
|
||||
// "The number of GT Block Timers must be less than or equal to 8"
|
||||
#define GT_BLOCK_TIMER_COUNT_MAX 8
|
||||
#define GT_BLOCK_TIMER_COUNT_MAX 8
|
||||
|
||||
// Local variables
|
||||
STATIC CONST UINT32* GtdtPlatformTimerCount;
|
||||
STATIC CONST UINT32* GtdtPlatformTimerOffset;
|
||||
STATIC CONST UINT8* PlatformTimerType;
|
||||
STATIC CONST UINT16* PlatformTimerLength;
|
||||
STATIC CONST UINT32* GtBlockTimerCount;
|
||||
STATIC CONST UINT32* GtBlockTimerOffset;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT32 *GtdtPlatformTimerCount;
|
||||
STATIC CONST UINT32 *GtdtPlatformTimerOffset;
|
||||
STATIC CONST UINT8 *PlatformTimerType;
|
||||
STATIC CONST UINT16 *PlatformTimerLength;
|
||||
STATIC CONST UINT32 *GtBlockTimerCount;
|
||||
STATIC CONST UINT32 *GtBlockTimerOffset;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
This function validates the GT Block timer count.
|
||||
@ -37,13 +37,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateGtBlockTimerCount (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT32 BlockTimerCount;
|
||||
UINT32 BlockTimerCount;
|
||||
|
||||
BlockTimerCount = *(UINT32*)Ptr;
|
||||
BlockTimerCount = *(UINT32 *)Ptr;
|
||||
|
||||
if (BlockTimerCount > GT_BLOCK_TIMER_COUNT_MAX) {
|
||||
IncrementErrorCount ();
|
||||
@ -66,13 +66,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateGtFrameNumber (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT8 FrameNumber;
|
||||
UINT8 FrameNumber;
|
||||
|
||||
FrameNumber = *(UINT8*)Ptr;
|
||||
FrameNumber = *(UINT8 *)Ptr;
|
||||
|
||||
if (FrameNumber >= GT_BLOCK_TIMER_COUNT_MAX) {
|
||||
IncrementErrorCount ();
|
||||
@ -87,82 +87,82 @@ ValidateGtFrameNumber (
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI GTDT Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GtdtParser[] = {
|
||||
STATIC CONST ACPI_PARSER GtdtParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL,
|
||||
NULL, NULL},
|
||||
{L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Secure EL1 timer GSIV", 4, 48, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Secure EL1 timer FLAGS", 4, 52, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"CntControlBase Physical Address",8, 36, L"0x%lx", NULL, NULL,
|
||||
NULL, NULL },
|
||||
{ L"Reserved", 4, 44, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Secure EL1 timer GSIV", 4, 48, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Secure EL1 timer FLAGS", 4, 52, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
|
||||
{L"Non-Secure EL1 timer GSIV", 4, 56, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Non-Secure EL1 timer FLAGS", 4, 60, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"Non-Secure EL1 timer GSIV", 4, 56, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Non-Secure EL1 timer FLAGS", 4, 60, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
|
||||
{L"Virtual timer GSIV", 4, 64, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Virtual timer FLAGS", 4, 68, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"Virtual timer GSIV", 4, 64, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Virtual timer FLAGS", 4, 68, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
|
||||
{L"Non-Secure EL2 timer GSIV", 4, 72, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Non-Secure EL2 timer FLAGS", 4, 76, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"Non-Secure EL2 timer GSIV", 4, 72, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Non-Secure EL2 timer FLAGS", 4, 76, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
|
||||
{L"CntReadBase Physical address", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Platform Timer Count", 4, 88, L"%d", NULL,
|
||||
(VOID**)&GtdtPlatformTimerCount, NULL, NULL},
|
||||
{L"Platform Timer Offset", 4, 92, L"0x%x", NULL,
|
||||
(VOID**)&GtdtPlatformTimerOffset, NULL, NULL},
|
||||
{L"Virtual EL2 Timer GSIV", 4, 96, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Virtual EL2 Timer Flags", 4, 100, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"CntReadBase Physical address", 8, 80, L"0x%lx", NULL, NULL,NULL, NULL },
|
||||
{ L"Platform Timer Count", 4, 88, L"%d", NULL,
|
||||
(VOID **)&GtdtPlatformTimerCount, NULL, NULL },
|
||||
{ L"Platform Timer Offset", 4, 92, L"0x%x", NULL,
|
||||
(VOID **)&GtdtPlatformTimerOffset,NULL, NULL },
|
||||
{ L"Virtual EL2 Timer GSIV", 4, 96, L"0x%x", NULL, NULL,NULL, NULL },
|
||||
{ L"Virtual EL2 Timer Flags", 4, 100, L"0x%x", NULL, NULL,NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Platform timer header.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = {
|
||||
{L"Type", 1, 0, NULL, NULL, (VOID**)&PlatformTimerType, NULL, NULL},
|
||||
{L"Length", 2, 1, NULL, NULL, (VOID**)&PlatformTimerLength, NULL, NULL},
|
||||
{L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = {
|
||||
{ L"Type", 1, 0, NULL, NULL, (VOID **)&PlatformTimerType, NULL, NULL },
|
||||
{ L"Length", 2, 1, NULL, NULL, (VOID **)&PlatformTimerLength, NULL, NULL },
|
||||
{ L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Platform GT Block.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GtBlockParser[] = {
|
||||
{L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL},
|
||||
{L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Timer Count", 4, 12, L"%d", NULL, (VOID**)&GtBlockTimerCount,
|
||||
ValidateGtBlockTimerCount, NULL},
|
||||
{L"Timer Offset", 4, 16, L"%d", NULL, (VOID**)&GtBlockTimerOffset, NULL,
|
||||
NULL}
|
||||
STATIC CONST ACPI_PARSER GtBlockParser[] = {
|
||||
{ L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Timer Count", 4, 12, L"%d", NULL, (VOID **)&GtBlockTimerCount,
|
||||
ValidateGtBlockTimerCount, NULL },
|
||||
{ L"Timer Offset", 4, 16, L"%d", NULL, (VOID **)&GtBlockTimerOffset, NULL,
|
||||
NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GT Block timer.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {
|
||||
{L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber, NULL},
|
||||
{L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},
|
||||
{L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL},
|
||||
{L"Physical Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Physical Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {
|
||||
{ L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber, NULL },
|
||||
{ L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
|
||||
{ L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Physical Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Platform Watchdog.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[] = {
|
||||
{L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL},
|
||||
{L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[] = {
|
||||
{ L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },
|
||||
{ L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -174,12 +174,12 @@ STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[] = {
|
||||
STATIC
|
||||
VOID
|
||||
DumpGTBlock (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
@ -193,7 +193,8 @@ DumpGTBlock (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((GtBlockTimerCount == NULL) ||
|
||||
(GtBlockTimerOffset == NULL)) {
|
||||
(GtBlockTimerOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient GT Block Structure length. Length = %d.\n",
|
||||
@ -203,12 +204,13 @@ DumpGTBlock (
|
||||
}
|
||||
|
||||
Offset = *GtBlockTimerOffset;
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
// Parse the specified number of GT Block Timer Structures or the GT Block
|
||||
// Structure buffer length. Whichever is minimum.
|
||||
while ((Index++ < *GtBlockTimerCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
Offset += ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -229,8 +231,8 @@ DumpGTBlock (
|
||||
STATIC
|
||||
VOID
|
||||
DumpWatchdogTimer (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -262,15 +264,15 @@ DumpWatchdogTimer (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiGtdt (
|
||||
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 Index;
|
||||
UINT32 Offset;
|
||||
UINT8* TimerPtr;
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
UINT8 *TimerPtr;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -288,7 +290,8 @@ ParseAcpiGtdt (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((GtdtPlatformTimerCount == NULL) ||
|
||||
(GtdtPlatformTimerOffset == NULL)) {
|
||||
(GtdtPlatformTimerOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient table length. AcpiTableLength = %d.\n",
|
||||
@ -298,13 +301,14 @@ ParseAcpiGtdt (
|
||||
}
|
||||
|
||||
TimerPtr = Ptr + *GtdtPlatformTimerOffset;
|
||||
Offset = *GtdtPlatformTimerOffset;
|
||||
Index = 0;
|
||||
Offset = *GtdtPlatformTimerOffset;
|
||||
Index = 0;
|
||||
|
||||
// Parse the specified number of Platform Timer Structures or the GTDT
|
||||
// buffer length. Whichever is minimum.
|
||||
while ((Index++ < *GtdtPlatformTimerCount) &&
|
||||
(Offset < AcpiTableLength)) {
|
||||
(Offset < AcpiTableLength))
|
||||
{
|
||||
// Parse the Platform Timer Header to obtain Length and Type
|
||||
ParseAcpi (
|
||||
FALSE,
|
||||
@ -318,11 +322,12 @@ ParseAcpiGtdt (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((PlatformTimerType == NULL) ||
|
||||
(PlatformTimerLength == NULL)) {
|
||||
(PlatformTimerLength == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient remaining table buffer length to read the " \
|
||||
L"Platform Timer Structure header. Length = %d.\n",
|
||||
L"Platform Timer Structure header. Length = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
return;
|
||||
@ -330,11 +335,12 @@ ParseAcpiGtdt (
|
||||
|
||||
// Validate Platform Timer Structure length
|
||||
if ((*PlatformTimerLength == 0) ||
|
||||
((Offset + (*PlatformTimerLength)) > AcpiTableLength)) {
|
||||
((Offset + (*PlatformTimerLength)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Platform Timer Structure length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*PlatformTimerLength,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
@ -359,6 +365,6 @@ ParseAcpiGtdt (
|
||||
} // switch
|
||||
|
||||
TimerPtr += *PlatformTimerLength;
|
||||
Offset += *PlatformTimerLength;
|
||||
Offset += *PlatformTimerLength;
|
||||
} // while
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -16,22 +16,22 @@
|
||||
#include "AcpiViewConfig.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
STATIC CONST UINT32* IortNodeCount;
|
||||
STATIC CONST UINT32* IortNodeOffset;
|
||||
STATIC CONST UINT32 *IortNodeCount;
|
||||
STATIC CONST UINT32 *IortNodeOffset;
|
||||
|
||||
STATIC CONST UINT8* IortNodeType;
|
||||
STATIC CONST UINT16* IortNodeLength;
|
||||
STATIC CONST UINT32* IortIdMappingCount;
|
||||
STATIC CONST UINT32* IortIdMappingOffset;
|
||||
STATIC CONST UINT8 *IortNodeType;
|
||||
STATIC CONST UINT16 *IortNodeLength;
|
||||
STATIC CONST UINT32 *IortIdMappingCount;
|
||||
STATIC CONST UINT32 *IortIdMappingOffset;
|
||||
|
||||
STATIC CONST UINT32* InterruptContextCount;
|
||||
STATIC CONST UINT32* InterruptContextOffset;
|
||||
STATIC CONST UINT32* PmuInterruptCount;
|
||||
STATIC CONST UINT32* PmuInterruptOffset;
|
||||
STATIC CONST UINT32 *InterruptContextCount;
|
||||
STATIC CONST UINT32 *InterruptContextOffset;
|
||||
STATIC CONST UINT32 *PmuInterruptCount;
|
||||
STATIC CONST UINT32 *PmuInterruptOffset;
|
||||
|
||||
STATIC CONST UINT32* ItsCount;
|
||||
STATIC CONST UINT32 *ItsCount;
|
||||
|
||||
/**
|
||||
This function validates the ID Mapping array count for the ITS node.
|
||||
@ -44,11 +44,11 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateItsIdMappingCount (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*(UINT32*)Ptr != 0) {
|
||||
if (*(UINT32 *)Ptr != 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nERROR: IORT ID Mapping count must be zero.");
|
||||
}
|
||||
@ -66,11 +66,11 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidatePmcgIdMappingCount (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*(UINT32*)Ptr > 1) {
|
||||
if (*(UINT32 *)Ptr > 1) {
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nERROR: IORT ID Mapping count must not be greater than 1.");
|
||||
}
|
||||
@ -87,11 +87,11 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateItsIdArrayReference (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*(UINT32*)Ptr != 0) {
|
||||
if (*(UINT32 *)Ptr != 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nERROR: IORT ID Mapping offset must be zero.");
|
||||
}
|
||||
@ -119,135 +119,135 @@ ValidateItsIdArrayReference (
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI IORT Table
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Number of IORT Nodes", 4, 36, L"%d", NULL,
|
||||
(VOID**)&IortNodeCount, NULL, NULL},
|
||||
{L"Offset to Array of IORT Nodes", 4, 40, L"0x%x", NULL,
|
||||
(VOID**)&IortNodeOffset, NULL, NULL},
|
||||
{L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"Number of IORT Nodes", 4, 36, L"%d", NULL,
|
||||
(VOID **)&IortNodeCount, NULL, NULL },
|
||||
{ L"Offset to Array of IORT Nodes",4, 40, L"0x%x", NULL,
|
||||
(VOID **)&IortNodeOffset, NULL, NULL },
|
||||
{ L"Reserved", 4, 44, L"0x%x", NULL,NULL,NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT node header structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeHeaderParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodeHeaderParser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL)
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT SMMUv1/2 node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL),
|
||||
{L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Span", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Model", 4, 32, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reference to Global Interrupt Array", 4, 40, L"0x%x", NULL, NULL, NULL,
|
||||
NULL},
|
||||
{L"Number of context interrupts", 4, 44, L"%d", NULL,
|
||||
(VOID**)&InterruptContextCount, NULL, NULL},
|
||||
{L"Reference to Context Interrupt Array", 4, 48, L"0x%x", NULL,
|
||||
(VOID**)&InterruptContextOffset, NULL, NULL},
|
||||
{L"Number of PMU Interrupts", 4, 52, L"%d", NULL,
|
||||
(VOID**)&PmuInterruptCount, NULL, NULL},
|
||||
{L"Reference to PMU Interrupt Array", 4, 56, L"0x%x", NULL,
|
||||
(VOID**)&PmuInterruptOffset, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL),
|
||||
{ L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Span", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Model", 4, 32, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reference to Global Interrupt Array",4, 40, L"0x%x", NULL, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Number of context interrupts", 4, 44, L"%d", NULL,
|
||||
(VOID **)&InterruptContextCount, NULL, NULL },
|
||||
{ L"Reference to Context Interrupt Array",4, 48, L"0x%x", NULL,
|
||||
(VOID **)&InterruptContextOffset, NULL, NULL },
|
||||
{ L"Number of PMU Interrupts", 4, 52, L"%d", NULL,
|
||||
(VOID **)&PmuInterruptCount, NULL, NULL },
|
||||
{ L"Reference to PMU Interrupt Array",4, 56, L"0x%x", NULL,
|
||||
(VOID **)&PmuInterruptOffset, NULL, NULL },
|
||||
|
||||
// Interrupt Array
|
||||
{L"SMMU_NSgIrpt", 4, 60, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SMMU_NSgIrpt interrupt flags", 4, 64, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SMMU_NSgCfgIrpt", 4, 68, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SMMU_NSgCfgIrpt interrupt flags", 4, 72, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"SMMU_NSgIrpt", 4, 60, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SMMU_NSgIrpt interrupt flags", 4, 64, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SMMU_NSgCfgIrpt", 4, 68, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SMMU_NSgCfgIrpt interrupt flags",4, 72, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER InterruptArrayParser[] = {
|
||||
{L"Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER InterruptArrayParser[] = {
|
||||
{ L"Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT ID Mapping.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {
|
||||
{L"Input base", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Number of IDs", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Output base", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Output reference", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {
|
||||
{ L"Input base", 4, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Number of IDs", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Output base", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Output reference", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT SMMUv3 node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL),
|
||||
{L"Base Address", 8, 16, L"0x%lx", NULL, 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},
|
||||
{L"VATOS Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Model", 4, 40, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Event", 4, 44, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PRI", 4, 48, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GERR", 4, 52, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Proximity domain", 4, 60, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Device ID mapping index", 4, 64, L"%d", NULL, NULL, NULL, NULL}
|
||||
{ L"Base Address", 8, 16, L"0x%lx", NULL, 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 },
|
||||
{ L"VATOS Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Model", 4, 40, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Event", 4, 44, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PRI", 4, 48, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GERR", 4, 52, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Proximity domain", 4, 60, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Device ID mapping index", 4, 64, L"%d", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT ITS node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeItsParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodeItsParser[] = {
|
||||
PARSE_IORT_NODE_HEADER (
|
||||
ValidateItsIdMappingCount,
|
||||
ValidateItsIdArrayReference
|
||||
),
|
||||
{L"Number of ITSs", 4, 16, L"%d", NULL, (VOID**)&ItsCount, NULL}
|
||||
{ L"Number of ITSs", 4,16, L"%d", NULL, (VOID **)&ItsCount, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ITS ID.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER ItsIdParser[] = {
|
||||
STATIC CONST ACPI_PARSER ItsIdParser[] = {
|
||||
{ L"GIC ITS Identifier", 4, 0, L"%d", NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT Names Component node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL),
|
||||
{L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Memory access properties", 8, 20, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Device memory address size limit", 1, 28, L"%d", NULL, NULL, NULL, NULL}
|
||||
{ L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Memory access properties",8, 20, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Device memory address size limit",1, 28, L"%d", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT Root Complex node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = {
|
||||
PARSE_IORT_NODE_HEADER (NULL, NULL),
|
||||
{L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Memory access size limit", 1, 32, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
|
||||
{ L"Memory access properties",8, 16, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Memory access size limit",1, 32, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IORT PMCG node.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
|
||||
STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
|
||||
PARSE_IORT_NODE_HEADER (ValidatePmcgIdMappingCount, NULL),
|
||||
{L"Page 0 Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Overflow interrupt GSIV", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL}
|
||||
{ L"Page 0 Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Overflow interrupt GSIV", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -260,20 +260,21 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeIdMappings (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 Length,
|
||||
IN UINT32 MappingCount
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 Length,
|
||||
IN UINT32 MappingCount
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
CHAR8 Buffer[40]; // Used for AsciiName param of ParseAcpi
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
CHAR8 Buffer[40]; // Used for AsciiName param of ParseAcpi
|
||||
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
Offset = 0;
|
||||
|
||||
while ((Index < MappingCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
sizeof (Buffer),
|
||||
@ -304,15 +305,15 @@ DumpIortNodeIdMappings (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeSmmuV1V2 (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
CHAR8 Buffer[50]; // Used for AsciiName param of ParseAcpi
|
||||
UINT32 Index;
|
||||
UINT32 Offset;
|
||||
CHAR8 Buffer[50]; // Used for AsciiName param of ParseAcpi
|
||||
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
@ -328,7 +329,8 @@ DumpIortNodeSmmuV1V2 (
|
||||
if ((InterruptContextCount == NULL) ||
|
||||
(InterruptContextOffset == NULL) ||
|
||||
(PmuInterruptCount == NULL) ||
|
||||
(PmuInterruptOffset == NULL)) {
|
||||
(PmuInterruptOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient SMMUv1/2 node length. Length = %d\n",
|
||||
@ -338,10 +340,11 @@ DumpIortNodeSmmuV1V2 (
|
||||
}
|
||||
|
||||
Offset = *InterruptContextOffset;
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
while ((Index < *InterruptContextCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
sizeof (Buffer),
|
||||
@ -360,10 +363,11 @@ DumpIortNodeSmmuV1V2 (
|
||||
}
|
||||
|
||||
Offset = *PmuInterruptOffset;
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
while ((Index < *PmuInterruptCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
sizeof (Buffer),
|
||||
@ -400,10 +404,10 @@ DumpIortNodeSmmuV1V2 (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeSmmuV3 (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -431,22 +435,22 @@ DumpIortNodeSmmuV3 (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeIts (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi
|
||||
|
||||
Offset = ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
"ITS Node",
|
||||
Ptr,
|
||||
Length,
|
||||
PARSER_PARAMS (IortNodeItsParser)
|
||||
);
|
||||
TRUE,
|
||||
2,
|
||||
"ITS Node",
|
||||
Ptr,
|
||||
Length,
|
||||
PARSER_PARAMS (IortNodeItsParser)
|
||||
);
|
||||
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
@ -462,7 +466,8 @@ DumpIortNodeIts (
|
||||
Index = 0;
|
||||
|
||||
while ((Index < *ItsCount) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
AsciiSPrint (
|
||||
Buffer,
|
||||
sizeof (Buffer),
|
||||
@ -481,7 +486,6 @@ DumpIortNodeIts (
|
||||
}
|
||||
|
||||
// Note: ITS does not have the ID Mappings Array
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -496,13 +500,13 @@ DumpIortNodeIts (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeNamedComponent (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 Offset;
|
||||
|
||||
Offset = ParseAcpi (
|
||||
TRUE,
|
||||
@ -517,10 +521,12 @@ DumpIortNodeNamedComponent (
|
||||
PrintFieldName (2, L"Device Object Name");
|
||||
|
||||
while ((*(Ptr + Offset) != 0) &&
|
||||
(Offset < Length)) {
|
||||
(Offset < Length))
|
||||
{
|
||||
Print (L"%c", *(Ptr + Offset));
|
||||
Offset++;
|
||||
}
|
||||
|
||||
Print (L"\n");
|
||||
|
||||
DumpIortNodeIdMappings (
|
||||
@ -542,10 +548,10 @@ DumpIortNodeNamedComponent (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodeRootComplex (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -576,11 +582,11 @@ DumpIortNodeRootComplex (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIortNodePmcg (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT16 Length,
|
||||
IN UINT32 MappingCount,
|
||||
IN UINT32 MappingOffset
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
@ -620,15 +626,15 @@ DumpIortNodePmcg (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiIort (
|
||||
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;
|
||||
UINT32 Index;
|
||||
UINT8* NodePtr;
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
UINT8 *NodePtr;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -646,7 +652,8 @@ ParseAcpiIort (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((IortNodeCount == NULL) ||
|
||||
(IortNodeOffset == NULL)) {
|
||||
(IortNodeOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient table length. AcpiTableLength = %d.\n",
|
||||
@ -655,14 +662,15 @@ ParseAcpiIort (
|
||||
return;
|
||||
}
|
||||
|
||||
Offset = *IortNodeOffset;
|
||||
Offset = *IortNodeOffset;
|
||||
NodePtr = Ptr + Offset;
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
// Parse the specified number of IORT nodes or the IORT table buffer length.
|
||||
// Whichever is minimum.
|
||||
while ((Index++ < *IortNodeCount) &&
|
||||
(Offset < AcpiTableLength)) {
|
||||
(Offset < AcpiTableLength))
|
||||
{
|
||||
// Parse the IORT Node Header
|
||||
ParseAcpi (
|
||||
FALSE,
|
||||
@ -678,11 +686,12 @@ ParseAcpiIort (
|
||||
if ((IortNodeType == NULL) ||
|
||||
(IortNodeLength == NULL) ||
|
||||
(IortIdMappingCount == NULL) ||
|
||||
(IortIdMappingOffset == NULL)) {
|
||||
(IortIdMappingOffset == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient remaining table buffer length to read the " \
|
||||
L"IORT node header. Length = %d.\n",
|
||||
L"IORT node header. Length = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
return;
|
||||
@ -690,11 +699,12 @@ ParseAcpiIort (
|
||||
|
||||
// Validate IORT Node length
|
||||
if ((*IortNodeLength == 0) ||
|
||||
((Offset + (*IortNodeLength)) > AcpiTableLength)) {
|
||||
((Offset + (*IortNodeLength)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid IORT Node length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*IortNodeLength,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
@ -750,7 +760,7 @@ ParseAcpiIort (
|
||||
*IortNodeLength,
|
||||
*IortIdMappingCount,
|
||||
*IortIdMappingOffset
|
||||
);
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -759,6 +769,6 @@ ParseAcpiIort (
|
||||
} // switch
|
||||
|
||||
NodePtr += (*IortNodeLength);
|
||||
Offset += (*IortNodeLength);
|
||||
Offset += (*IortNodeLength);
|
||||
} // while
|
||||
}
|
||||
|
@ -19,9 +19,9 @@
|
||||
#include "MadtParser.h"
|
||||
|
||||
// Local Variables
|
||||
STATIC CONST UINT8* MadtInterruptControllerType;
|
||||
STATIC CONST UINT8* MadtInterruptControllerLength;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT8 *MadtInterruptControllerType;
|
||||
STATIC CONST UINT8 *MadtInterruptControllerLength;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
This function validates the System Vector Base in the GICD.
|
||||
@ -34,15 +34,15 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateGICDSystemVectorBase (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
)
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
if (*(UINT32*)Ptr != 0) {
|
||||
if (*(UINT32 *)Ptr != 0) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: System Vector Base must be zero."
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,13 +57,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateSpeOverflowInterrupt (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT16 SpeOverflowInterrupt;
|
||||
UINT16 SpeOverflowInterrupt;
|
||||
|
||||
SpeOverflowInterrupt = *(UINT16*)Ptr;
|
||||
SpeOverflowInterrupt = *(UINT16 *)Ptr;
|
||||
|
||||
// SPE not supported by this processor
|
||||
if (SpeOverflowInterrupt == 0) {
|
||||
@ -73,183 +73,183 @@ ValidateSpeOverflowInterrupt (
|
||||
if ((SpeOverflowInterrupt < ARM_PPI_ID_MIN) ||
|
||||
((SpeOverflowInterrupt > ARM_PPI_ID_MAX) &&
|
||||
(SpeOverflowInterrupt < ARM_PPI_ID_EXTENDED_MIN)) ||
|
||||
(SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX)) {
|
||||
(SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: SPE Overflow Interrupt ID of %d is not in the allowed PPI ID "
|
||||
L"ranges of %d-%d or %d-%d (for GICv3.1 or later).",
|
||||
L"ranges of %d-%d or %d-%d (for GICv3.1 or later).",
|
||||
SpeOverflowInterrupt,
|
||||
ARM_PPI_ID_MIN,
|
||||
ARM_PPI_ID_MAX,
|
||||
ARM_PPI_ID_EXTENDED_MIN,
|
||||
ARM_PPI_ID_EXTENDED_MAX
|
||||
);
|
||||
);
|
||||
} else if (SpeOverflowInterrupt != ARM_PPI_ID_PMBIRQ) {
|
||||
IncrementWarningCount();
|
||||
IncrementWarningCount ();
|
||||
Print (
|
||||
L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with SBSA "
|
||||
L"Level 3 PPI ID assignment: %d.",
|
||||
L"Level 3 PPI ID assignment: %d.",
|
||||
SpeOverflowInterrupt,
|
||||
ARM_PPI_ID_PMBIRQ
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GICC Interrupt Controller Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GicCParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER GicCParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"CPU Interface Number", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ACPI Processor UID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Parking Protocol Version", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"CPU Interface Number", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ACPI Processor UID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Parking Protocol Version", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Performance Interrupt GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Parked Address", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Physical Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"GICV", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"GICH", 8, 48, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"VGIC Maintenance interrupt", 4, 56, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"GICR Base Address", 8, 60, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"MPIDR", 8, 68, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Processor Power Efficiency Class", 1, 76, L"0x%x", NULL, NULL, NULL,
|
||||
NULL},
|
||||
{L"Reserved", 1, 77, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SPE overflow Interrupt", 2, 78, L"0x%x", NULL, NULL,
|
||||
ValidateSpeOverflowInterrupt, NULL}
|
||||
{ L"Performance Interrupt GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Parked Address", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"GICV", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"GICH", 8, 48, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"VGIC Maintenance interrupt", 4, 56, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"GICR Base Address", 8, 60, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"MPIDR", 8, 68, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Processor Power Efficiency Class", 1, 76, L"0x%x", NULL, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Reserved", 1, 77, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SPE overflow Interrupt", 2, 78, L"0x%x", NULL, NULL,
|
||||
ValidateSpeOverflowInterrupt, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GICD Interrupt Controller Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GicDParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER GicDParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"GIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"System Vector Base", 4, 16, L"0x%x", NULL, NULL,
|
||||
ValidateGICDSystemVectorBase, NULL},
|
||||
{L"GIC Version", 1, 20, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 21, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
|
||||
{ L"GIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"System Vector Base", 4, 16, L"0x%x", NULL, NULL,
|
||||
ValidateGICDSystemVectorBase, NULL },
|
||||
{ L"GIC Version", 1, 20, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 21, L"%x %x %x", Dump3Chars, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the MSI Frame Interrupt Controller Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GicMSIFrameParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER GicMSIFrameParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"MSI Frame ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"MSI Frame ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"SPI Count", 2, 20, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"SPI Base", 2, 22, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"SPI Count", 2, 20, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"SPI Base", 2, 22, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GICR Interrupt Controller Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GicRParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER GicRParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Discovery Range Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL},
|
||||
{L"Discovery Range Length", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"Discovery Range Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Discovery Range Length", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the GIC ITS Interrupt Controller Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER GicITSParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER GicITSParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"GIC ITS ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"GIC ITS ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the IO APIC Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IoApic[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"I/O APIC ID", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"I/O APIC Address", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Global System Interrupt Base", 4, 8, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER IoApic[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"I/O APIC ID", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"I/O APIC Address", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Global System Interrupt Base", 4, 8, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Interrupt Source Override Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER InterruptSourceOverride[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Bus", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Source", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Global System Interrupt", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER InterruptSourceOverride[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Bus", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Source", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Global System Interrupt", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Processor Local x2APIC Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER ProcessorLocalX2Apic[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER ProcessorLocalX2Apic[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"X2APIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ACPI Processor UID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"X2APIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ACPI Processor UID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Local x2APIC NMI Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER LocalX2ApicNmi[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Flags", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER LocalX2ApicNmi[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Flags", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"ACPI Processor UID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Local x2APIC LINT#", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 9, L"0x%x%x%x", Dump3Chars, NULL, NULL, NULL}
|
||||
{ L"ACPI Processor UID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Local x2APIC LINT#", 1, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 9, L"0x%x%x%x", Dump3Chars, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI MADT Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER MadtParser[] = {
|
||||
STATIC CONST ACPI_PARSER MadtParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Local Interrupt Controller Address", 4, 36, L"0x%x", NULL, NULL, NULL,
|
||||
NULL},
|
||||
{L"Flags", 4, 40, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
{ L"Local Interrupt Controller Address",4, 36, L"0x%x", NULL, NULL, NULL,
|
||||
NULL },
|
||||
{ L"Flags", 4, 40, L"0x%x", NULL, NULL, NULL,NULL}
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the MADT Interrupt Controller Structure Header Structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
|
||||
{NULL, 1, 0, NULL, NULL, (VOID**)&MadtInterruptControllerType, NULL, NULL},
|
||||
{L"Length", 1, 1, NULL, NULL, (VOID**)&MadtInterruptControllerLength, NULL,
|
||||
NULL},
|
||||
{L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
|
||||
{ NULL, 1, 0, NULL, NULL, (VOID **)&MadtInterruptControllerType, NULL, NULL },
|
||||
{ L"Length", 1, 1, NULL, NULL, (VOID **)&MadtInterruptControllerLength, NULL,
|
||||
NULL },
|
||||
{ L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -275,15 +275,15 @@ STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiMadt (
|
||||
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* InterruptContollerPtr;
|
||||
UINT32 GICDCount;
|
||||
UINT32 Offset;
|
||||
UINT8 *InterruptContollerPtr;
|
||||
UINT32 GICDCount;
|
||||
|
||||
GICDCount = 0;
|
||||
|
||||
@ -315,11 +315,12 @@ ParseAcpiMadt (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((MadtInterruptControllerType == NULL) ||
|
||||
(MadtInterruptControllerLength == NULL)) {
|
||||
(MadtInterruptControllerLength == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient remaining table buffer length to read the " \
|
||||
L"Interrupt Controller Structure header. Length = %d.\n",
|
||||
L"Interrupt Controller Structure header. Length = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
return;
|
||||
@ -327,11 +328,12 @@ ParseAcpiMadt (
|
||||
|
||||
// Validate Interrupt Controller Structure length
|
||||
if ((*MadtInterruptControllerLength == 0) ||
|
||||
((Offset + (*MadtInterruptControllerLength)) > AcpiTableLength)) {
|
||||
((Offset + (*MadtInterruptControllerLength)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Interrupt Controller Structure length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*MadtInterruptControllerLength,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
@ -340,7 +342,8 @@ ParseAcpiMadt (
|
||||
}
|
||||
|
||||
switch (*MadtInterruptControllerType) {
|
||||
case EFI_ACPI_6_3_GIC: {
|
||||
case EFI_ACPI_6_3_GIC:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -352,15 +355,17 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_GICD: {
|
||||
case EFI_ACPI_6_3_GICD:
|
||||
{
|
||||
if (++GICDCount > 1) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Only one GICD must be present,"
|
||||
L" GICDCount = %d\n",
|
||||
L" GICDCount = %d\n",
|
||||
GICDCount
|
||||
);
|
||||
}
|
||||
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -372,7 +377,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_GIC_MSI_FRAME: {
|
||||
case EFI_ACPI_6_3_GIC_MSI_FRAME:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -384,7 +390,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_GICR: {
|
||||
case EFI_ACPI_6_3_GICR:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -396,7 +403,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_GIC_ITS: {
|
||||
case EFI_ACPI_6_3_GIC_ITS:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -408,7 +416,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_IO_APIC: {
|
||||
case EFI_ACPI_6_3_IO_APIC:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -420,7 +429,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_INTERRUPT_SOURCE_OVERRIDE: {
|
||||
case EFI_ACPI_6_3_INTERRUPT_SOURCE_OVERRIDE:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -432,7 +442,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC: {
|
||||
case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -444,7 +455,8 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
case EFI_ACPI_6_3_LOCAL_X2APIC_NMI: {
|
||||
case EFI_ACPI_6_3_LOCAL_X2APIC_NMI:
|
||||
{
|
||||
ParseAcpi (
|
||||
TRUE,
|
||||
2,
|
||||
@ -456,11 +468,12 @@ ParseAcpiMadt (
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
default:
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Unknown Interrupt Controller Structure,"
|
||||
L" Type = %d, Length = %d\n",
|
||||
L" Type = %d, Length = %d\n",
|
||||
*MadtInterruptControllerType,
|
||||
*MadtInterruptControllerLength
|
||||
);
|
||||
@ -468,6 +481,6 @@ ParseAcpiMadt (
|
||||
} // switch
|
||||
|
||||
InterruptContollerPtr += *MadtInterruptControllerLength;
|
||||
Offset += *MadtInterruptControllerLength;
|
||||
Offset += *MadtInterruptControllerLength;
|
||||
} // while
|
||||
}
|
||||
|
@ -16,25 +16,25 @@
|
||||
///
|
||||
/// Level 3 base server system Private Peripheral Inerrupt (PPI) ID assignments
|
||||
///
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTP 30
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTPS 29
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTHV 28
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTV 27
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTHP 26
|
||||
#define ARM_PPI_ID_GIC_MAINTENANCE_INTERRUPT 25
|
||||
#define ARM_PPI_ID_CTIIRQ 24
|
||||
#define ARM_PPI_ID_PERFORMANCE_MONITORS_INTERRUPT 23
|
||||
#define ARM_PPI_ID_COMMIRQ 22
|
||||
#define ARM_PPI_ID_PMBIRQ 21
|
||||
#define ARM_PPI_ID_CNTHPS 20
|
||||
#define ARM_PPI_ID_CNTHVS 19
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTP 30
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTPS 29
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTHV 28
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTV 27
|
||||
#define ARM_PPI_ID_OVERFLOW_INTERRUPT_FROM_CNTHP 26
|
||||
#define ARM_PPI_ID_GIC_MAINTENANCE_INTERRUPT 25
|
||||
#define ARM_PPI_ID_CTIIRQ 24
|
||||
#define ARM_PPI_ID_PERFORMANCE_MONITORS_INTERRUPT 23
|
||||
#define ARM_PPI_ID_COMMIRQ 22
|
||||
#define ARM_PPI_ID_PMBIRQ 21
|
||||
#define ARM_PPI_ID_CNTHPS 20
|
||||
#define ARM_PPI_ID_CNTHVS 19
|
||||
|
||||
///
|
||||
/// PPI ID allowed ranges
|
||||
///
|
||||
#define ARM_PPI_ID_MAX 31
|
||||
#define ARM_PPI_ID_MIN 16
|
||||
#define ARM_PPI_ID_EXTENDED_MAX 1119
|
||||
#define ARM_PPI_ID_EXTENDED_MIN 1056
|
||||
#define ARM_PPI_ID_MAX 31
|
||||
#define ARM_PPI_ID_MIN 16
|
||||
#define ARM_PPI_ID_EXTENDED_MAX 1119
|
||||
#define ARM_PPI_ID_EXTENDED_MIN 1056
|
||||
|
||||
#endif // MADT_PARSER_H_
|
||||
|
@ -14,25 +14,25 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI MCFG Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER McfgParser[] = {
|
||||
STATIC CONST ACPI_PARSER McfgParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Reserved", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{ L"Reserved", 8,36, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the PCI configuration Space Base Address structure.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
|
||||
{L"Base Address", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Segment Group No.", 2, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Start Bus No.", 1, 10, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"End Bus No.", 1, 11, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
|
||||
{ L"Base Address", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Segment Group No.", 2, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Start Bus No.", 1, 10, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"End Bus No.", 1, 11, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -50,15 +50,15 @@ STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiMcfg (
|
||||
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;
|
||||
UINT32 PciCfgOffset;
|
||||
UINT8* PciCfgSpacePtr;
|
||||
UINT32 Offset;
|
||||
UINT32 PciCfgOffset;
|
||||
UINT8 *PciCfgSpacePtr;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -85,6 +85,6 @@ ParseAcpiMcfg (
|
||||
PARSER_PARAMS (PciCfgSpaceBaseAddrParser)
|
||||
);
|
||||
PciCfgSpacePtr += PciCfgOffset;
|
||||
Offset += PciCfgOffset;
|
||||
Offset += PciCfgOffset;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include "PpttParser.h"
|
||||
|
||||
// Local variables
|
||||
STATIC CONST UINT8* ProcessorTopologyStructureType;
|
||||
STATIC CONST UINT8* ProcessorTopologyStructureLength;
|
||||
STATIC CONST UINT32* NumberOfPrivateResources;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT8 *ProcessorTopologyStructureType;
|
||||
STATIC CONST UINT8 *ProcessorTopologyStructureLength;
|
||||
STATIC CONST UINT32 *NumberOfPrivateResources;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
This function validates the Cache Type Structure (Type 1) 'Number of sets'
|
||||
@ -34,12 +34,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateCacheNumberOfSets (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT32 NumberOfSets;
|
||||
NumberOfSets = *(UINT32*)Ptr;
|
||||
UINT32 NumberOfSets;
|
||||
|
||||
NumberOfSets = *(UINT32 *)Ptr;
|
||||
|
||||
if (NumberOfSets == 0) {
|
||||
IncrementErrorCount ();
|
||||
@ -47,12 +48,12 @@ ValidateCacheNumberOfSets (
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
if (NumberOfSets > PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: When ARMv8.3-CCIDX is implemented the maximum cache number of "
|
||||
L"sets must be less than or equal to %d",
|
||||
L"sets must be less than or equal to %d",
|
||||
PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX
|
||||
);
|
||||
return;
|
||||
@ -62,14 +63,14 @@ ValidateCacheNumberOfSets (
|
||||
IncrementWarningCount ();
|
||||
Print (
|
||||
L"\nWARNING: Without ARMv8.3-CCIDX, the maximum cache number of sets "
|
||||
L"must be less than or equal to %d. Ignore this message if "
|
||||
L"ARMv8.3-CCIDX is implemented",
|
||||
L"must be less than or equal to %d. Ignore this message if "
|
||||
L"ARMv8.3-CCIDX is implemented",
|
||||
PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX
|
||||
);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,12 +85,13 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateCacheAssociativity (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINT8 Associativity;
|
||||
Associativity = *(UINT8*)Ptr;
|
||||
UINT8 Associativity;
|
||||
|
||||
Associativity = *(UINT8 *)Ptr;
|
||||
|
||||
if (Associativity == 0) {
|
||||
IncrementErrorCount ();
|
||||
@ -109,25 +111,26 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateCacheLineSize (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
// Reference: ARM Architecture Reference Manual ARMv8 (D.a)
|
||||
// Section D12.2.25: CCSIDR_EL1, Current Cache Size ID Register
|
||||
// LineSize, bits [2:0]
|
||||
// (Log2(Number of bytes in cache line)) - 4.
|
||||
|
||||
UINT16 LineSize;
|
||||
LineSize = *(UINT16*)Ptr;
|
||||
UINT16 LineSize;
|
||||
LineSize = *(UINT16 *)Ptr;
|
||||
|
||||
if ((LineSize < PPTT_ARM_CACHE_LINE_SIZE_MIN) ||
|
||||
(LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX)) {
|
||||
(LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: The cache line size must be between %d and %d bytes"
|
||||
L" on ARM Platforms.",
|
||||
L" on ARM Platforms.",
|
||||
PPTT_ARM_CACHE_LINE_SIZE_MIN,
|
||||
PPTT_ARM_CACHE_LINE_SIZE_MAX
|
||||
);
|
||||
@ -138,7 +141,8 @@ ValidateCacheLineSize (
|
||||
IncrementErrorCount ();
|
||||
Print (L"\nERROR: The cache line size is not a power of 2.");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,15 +156,16 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateCacheAttributes (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
// Reference: Advanced Configuration and Power Interface (ACPI) Specification
|
||||
// Version 6.2 Errata A, September 2017
|
||||
// Table 5-153: Cache Type Structure
|
||||
UINT8 Attributes;
|
||||
Attributes = *(UINT8*)Ptr;
|
||||
UINT8 Attributes;
|
||||
|
||||
Attributes = *(UINT8 *)Ptr;
|
||||
|
||||
if ((Attributes & 0xE0) != 0) {
|
||||
IncrementErrorCount ();
|
||||
@ -175,67 +180,67 @@ ValidateCacheAttributes (
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI PPTT Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER PpttParser[] = {
|
||||
STATIC CONST ACPI_PARSER PpttParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo)
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the processor topology structure header.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER ProcessorTopologyStructureHeaderParser[] = {
|
||||
{L"Type", 1, 0, NULL, NULL, (VOID**)&ProcessorTopologyStructureType,
|
||||
NULL, NULL},
|
||||
{L"Length", 1, 1, NULL, NULL, (VOID**)&ProcessorTopologyStructureLength,
|
||||
NULL, NULL},
|
||||
{L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER ProcessorTopologyStructureHeaderParser[] = {
|
||||
{ L"Type", 1, 0, NULL, NULL, (VOID **)&ProcessorTopologyStructureType,
|
||||
NULL, NULL },
|
||||
{ L"Length", 1, 1, NULL, NULL, (VOID **)&ProcessorTopologyStructureLength,
|
||||
NULL, NULL },
|
||||
{ L"Reserved", 2, 2, NULL, NULL, NULL, NULL,NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Processor Hierarchy Node Structure - Type 0.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER ProcessorHierarchyNodeStructureParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER ProcessorHierarchyNodeStructureParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Parent", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"ACPI Processor ID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Number of private resources", 4, 16, L"%d", NULL,
|
||||
(VOID**)&NumberOfPrivateResources, NULL, NULL}
|
||||
{ L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Parent", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"ACPI Processor ID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Number of private resources", 4, 16, L"%d", NULL,
|
||||
(VOID **)&NumberOfPrivateResources, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the Cache Type Structure - Type 1.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER CacheTypeStructureParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER CacheTypeStructureParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Next Level of Cache", 4, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Size", 4, 12, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Number of sets", 4, 16, L"%d", NULL, NULL, ValidateCacheNumberOfSets, NULL},
|
||||
{L"Associativity", 1, 20, L"%d", NULL, NULL, ValidateCacheAssociativity, NULL},
|
||||
{L"Attributes", 1, 21, L"0x%x", NULL, NULL, ValidateCacheAttributes, NULL},
|
||||
{L"Line size", 2, 22, L"%d", NULL, NULL, ValidateCacheLineSize, NULL}
|
||||
{ L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Next Level of Cache", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Size", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Number of sets", 4, 16, L"%d", NULL, NULL, ValidateCacheNumberOfSets, NULL },
|
||||
{ L"Associativity", 1, 20, L"%d", NULL, NULL, ValidateCacheAssociativity, NULL },
|
||||
{ L"Attributes", 1, 21, L"0x%x", NULL, NULL, ValidateCacheAttributes, NULL },
|
||||
{ L"Line size", 2, 22, L"%d", NULL, NULL, ValidateCacheLineSize, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ID Type Structure - Type 2.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER IdStructureParser[] = {
|
||||
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
STATIC CONST ACPI_PARSER IdStructureParser[] = {
|
||||
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"VENDOR_ID", 4, 4, NULL, Dump4Chars, NULL, NULL, NULL},
|
||||
{L"LEVEL_1_ID", 8, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"LEVEL_2_ID", 8, 16, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"MAJOR_REV", 2, 24, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"MINOR_REV", 2, 26, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"SPIN_REV", 2, 28, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{ L"VENDOR_ID", 4, 4, NULL, Dump4Chars, NULL, NULL, NULL },
|
||||
{ L"LEVEL_1_ID", 8, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"LEVEL_2_ID", 8, 16, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"MAJOR_REV", 2, 24, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"MINOR_REV", 2, 26, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"SPIN_REV", 2, 28, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
/**
|
||||
@ -248,13 +253,13 @@ STATIC CONST ACPI_PARSER IdStructureParser[] = {
|
||||
STATIC
|
||||
VOID
|
||||
DumpProcessorHierarchyNodeStructure (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT8 Length
|
||||
)
|
||||
{
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
|
||||
UINT32 Offset;
|
||||
UINT32 Index;
|
||||
CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
|
||||
|
||||
Offset = ParseAcpi (
|
||||
TRUE,
|
||||
@ -281,8 +286,8 @@ DumpProcessorHierarchyNodeStructure (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Number of Private Resources. " \
|
||||
L"PrivateResourceCount = %d. RemainingBufferLength = %d. " \
|
||||
L"Parsing of this structure aborted.\n",
|
||||
L"PrivateResourceCount = %d. RemainingBufferLength = %d. " \
|
||||
L"Parsing of this structure aborted.\n",
|
||||
*NumberOfPrivateResources,
|
||||
Length - Offset
|
||||
);
|
||||
@ -304,7 +309,7 @@ DumpProcessorHierarchyNodeStructure (
|
||||
PrintFieldName (4, Buffer);
|
||||
Print (
|
||||
L"0x%x\n",
|
||||
*((UINT32*)(Ptr + Offset))
|
||||
*((UINT32 *)(Ptr + Offset))
|
||||
);
|
||||
|
||||
Offset += sizeof (UINT32);
|
||||
@ -321,7 +326,7 @@ DumpProcessorHierarchyNodeStructure (
|
||||
STATIC
|
||||
VOID
|
||||
DumpCacheTypeStructure (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT8 Length
|
||||
)
|
||||
{
|
||||
@ -344,8 +349,8 @@ DumpCacheTypeStructure (
|
||||
STATIC
|
||||
VOID
|
||||
DumpIDStructure (
|
||||
IN UINT8* Ptr,
|
||||
IN UINT8 Length
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT8 Length
|
||||
)
|
||||
{
|
||||
ParseAcpi (
|
||||
@ -378,14 +383,14 @@ DumpIDStructure (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiPptt (
|
||||
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* ProcessorTopologyStructurePtr;
|
||||
UINT32 Offset;
|
||||
UINT8 *ProcessorTopologyStructurePtr;
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -416,11 +421,12 @@ ParseAcpiPptt (
|
||||
// Check if the values used to control the parsing logic have been
|
||||
// successfully read.
|
||||
if ((ProcessorTopologyStructureType == NULL) ||
|
||||
(ProcessorTopologyStructureLength == NULL)) {
|
||||
(ProcessorTopologyStructureLength == NULL))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient remaining table buffer length to read the " \
|
||||
L"processor topology structure header. Length = %d.\n",
|
||||
L"processor topology structure header. Length = %d.\n",
|
||||
AcpiTableLength - Offset
|
||||
);
|
||||
return;
|
||||
@ -428,11 +434,12 @@ ParseAcpiPptt (
|
||||
|
||||
// Validate Processor Topology Structure length
|
||||
if ((*ProcessorTopologyStructureLength == 0) ||
|
||||
((Offset + (*ProcessorTopologyStructureLength)) > AcpiTableLength)) {
|
||||
((Offset + (*ProcessorTopologyStructureLength)) > AcpiTableLength))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Processor Topology Structure length. " \
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
|
||||
*ProcessorTopologyStructureLength,
|
||||
Offset,
|
||||
AcpiTableLength
|
||||
@ -466,13 +473,13 @@ ParseAcpiPptt (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Unknown processor topology structure:"
|
||||
L" Type = %d, Length = %d\n",
|
||||
L" Type = %d, Length = %d\n",
|
||||
*ProcessorTopologyStructureType,
|
||||
*ProcessorTopologyStructureLength
|
||||
);
|
||||
}
|
||||
|
||||
ProcessorTopologyStructurePtr += *ProcessorTopologyStructureLength;
|
||||
Offset += *ProcessorTopologyStructureLength;
|
||||
Offset += *ProcessorTopologyStructureLength;
|
||||
} // while
|
||||
}
|
||||
|
@ -16,22 +16,22 @@
|
||||
/// Cache parameters allowed by the architecture with
|
||||
/// ARMv8.3-CCIDX (Cache extended number of sets)
|
||||
/// Derived from CCSIDR_EL1 when ID_AA64MMFR2_EL1.CCIDX==0001
|
||||
#define PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX (1 << 24)
|
||||
#define PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX (1 << 21)
|
||||
#define PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX (1 << 24)
|
||||
#define PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX (1 << 21)
|
||||
|
||||
/// Cache parameters allowed by the architecture without
|
||||
/// ARMv8.3-CCIDX (Cache extended number of sets)
|
||||
/// Derived from CCSIDR_EL1 when ID_AA64MMFR2_EL1.CCIDX==0000
|
||||
#define PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX (1 << 15)
|
||||
#define PPTT_ARM_CACHE_ASSOCIATIVITY_MAX (1 << 10)
|
||||
#define PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX (1 << 15)
|
||||
#define PPTT_ARM_CACHE_ASSOCIATIVITY_MAX (1 << 10)
|
||||
|
||||
/// Common cache parameters
|
||||
/// Derived from CCSIDR_EL1
|
||||
/// The LineSize is represented by bits 2:0
|
||||
/// (Log2(Number of bytes in cache line)) - 4 is used to represent
|
||||
/// the LineSize bits.
|
||||
#define PPTT_ARM_CACHE_LINE_SIZE_MAX (1 << 11)
|
||||
#define PPTT_ARM_CACHE_LINE_SIZE_MIN (1 << 4)
|
||||
#define PPTT_ARM_CACHE_LINE_SIZE_MAX (1 << 11)
|
||||
#define PPTT_ARM_CACHE_LINE_SIZE_MIN (1 << 4)
|
||||
|
||||
#endif // if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local Variables
|
||||
STATIC CONST UINT64* XsdtAddress;
|
||||
STATIC CONST UINT64 *XsdtAddress;
|
||||
|
||||
/**
|
||||
This function validates the RSDT Address.
|
||||
@ -26,19 +26,19 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateRsdtAddress (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
// Reference: Server Base Boot Requirements System Software on ARM Platforms
|
||||
// Section: 4.2.1.1 RSDP
|
||||
// Root System Description Pointer (RSDP), ACPI ? 5.2.5.
|
||||
// - Within the RSDP, the RsdtAddress field must be null (zero) and the
|
||||
// XsdtAddresss MUST be a valid, non-null, 64-bit value.
|
||||
UINT32 RsdtAddr;
|
||||
UINT32 RsdtAddr;
|
||||
|
||||
RsdtAddr = *(UINT32*)Ptr;
|
||||
RsdtAddr = *(UINT32 *)Ptr;
|
||||
|
||||
if (RsdtAddr != 0) {
|
||||
IncrementErrorCount ();
|
||||
@ -47,7 +47,8 @@ ValidateRsdtAddress (
|
||||
RsdtAddr
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,19 +62,19 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateXsdtAddress (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
// Reference: Server Base Boot Requirements System Software on ARM Platforms
|
||||
// Section: 4.2.1.1 RSDP
|
||||
// Root System Description Pointer (RSDP), ACPI ? 5.2.5.
|
||||
// - Within the RSDP, the RsdtAddress field must be null (zero) and the
|
||||
// XsdtAddresss MUST be a valid, non-null, 64-bit value.
|
||||
UINT64 XsdtAddr;
|
||||
UINT64 XsdtAddr;
|
||||
|
||||
XsdtAddr = *(UINT64*)Ptr;
|
||||
XsdtAddr = *(UINT64 *)Ptr;
|
||||
|
||||
if (XsdtAddr == 0) {
|
||||
IncrementErrorCount ();
|
||||
@ -82,23 +83,24 @@ ValidateXsdtAddress (
|
||||
XsdtAddr
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
An array describing the ACPI RSDP Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER RsdpParser[] = {
|
||||
{L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL},
|
||||
{L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL},
|
||||
{L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL},
|
||||
{L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID**)&XsdtAddress,
|
||||
ValidateXsdtAddress, NULL},
|
||||
{L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
|
||||
STATIC CONST ACPI_PARSER RsdpParser[] = {
|
||||
{ L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL },
|
||||
{ L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL },
|
||||
{ L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL },
|
||||
{ L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID **)&XsdtAddress,
|
||||
ValidateXsdtAddress, NULL },
|
||||
{ L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -118,10 +120,10 @@ STATIC CONST ACPI_PARSER RsdpParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiRsdp (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (Trace) {
|
||||
@ -144,7 +146,7 @@ ParseAcpiRsdp (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Insufficient table length. AcpiTableLength = %d." \
|
||||
L"RSDP parsing aborted.\n",
|
||||
L"RSDP parsing aborted.\n",
|
||||
AcpiTableLength
|
||||
);
|
||||
return;
|
||||
@ -160,5 +162,5 @@ ParseAcpiRsdp (
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessAcpiTable ((UINT8*)(UINTN)(*XsdtAddress));
|
||||
ProcessAcpiTable ((UINT8 *)(UINTN)(*XsdtAddress));
|
||||
}
|
||||
|
@ -15,22 +15,22 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local Variables
|
||||
STATIC CONST UINT64* SlitSystemLocalityCount;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC CONST UINT64 *SlitSystemLocalityCount;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI SLIT table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER SlitParser[] = {
|
||||
STATIC CONST ACPI_PARSER SlitParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Number of System Localities", 8, 36, L"0x%lx", NULL,
|
||||
(VOID**)&SlitSystemLocalityCount, NULL, NULL}
|
||||
{ L"Number of System Localities", 8, 36, L"0x%lx", NULL,
|
||||
(VOID **)&SlitSystemLocalityCount,NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
Macro to get the value of a System Locality
|
||||
**/
|
||||
#define SLIT_ELEMENT(Ptr, i, j) *(Ptr + (i * LocalityCount) + j)
|
||||
#define SLIT_ELEMENT(Ptr, i, j) *(Ptr + (i * LocalityCount) + j)
|
||||
|
||||
/**
|
||||
This function parses the ACPI SLIT table.
|
||||
@ -50,18 +50,18 @@ STATIC CONST ACPI_PARSER SlitParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiSlit (
|
||||
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;
|
||||
UINT32 Count;
|
||||
UINT32 Index;
|
||||
UINT32 LocalityCount;
|
||||
UINT8* LocalityPtr;
|
||||
CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi
|
||||
UINT32 Offset;
|
||||
UINT32 Count;
|
||||
UINT32 Index;
|
||||
UINT32 LocalityCount;
|
||||
UINT8 *LocalityPtr;
|
||||
CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi
|
||||
|
||||
if (!Trace) {
|
||||
return;
|
||||
@ -103,8 +103,8 @@ ParseAcpiSlit (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: The Number of System Localities provided can't be represented " \
|
||||
L"in the SLIT table. SlitSystemLocalityCount = %ld. " \
|
||||
L"MaxLocalityCountAllowed = %d.\n",
|
||||
L"in the SLIT table. SlitSystemLocalityCount = %ld. " \
|
||||
L"MaxLocalityCountAllowed = %d.\n",
|
||||
*SlitSystemLocalityCount,
|
||||
MAX_UINT16
|
||||
);
|
||||
@ -118,7 +118,7 @@ ParseAcpiSlit (
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid Number of System Localities. " \
|
||||
L"SlitSystemLocalityCount = %ld. AcpiTableLength = %d.\n",
|
||||
L"SlitSystemLocalityCount = %ld. AcpiTableLength = %d.\n",
|
||||
*SlitSystemLocalityCount,
|
||||
AcpiTableLength
|
||||
);
|
||||
@ -144,12 +144,14 @@ ParseAcpiSlit (
|
||||
for (Index = 0; Index < LocalityCount; Index++) {
|
||||
Print (L" (%3d) ", Index);
|
||||
}
|
||||
|
||||
Print (L"\n");
|
||||
for (Count = 0; Count< LocalityCount; Count++) {
|
||||
for (Count = 0; Count < LocalityCount; Count++) {
|
||||
Print (L" (%3d) ", Count);
|
||||
for (Index = 0; Index < LocalityCount; Index++) {
|
||||
Print (L" %3d ", SLIT_ELEMENT (LocalityPtr, Count, Index));
|
||||
}
|
||||
|
||||
Print (L"\n");
|
||||
}
|
||||
}
|
||||
@ -158,23 +160,25 @@ ParseAcpiSlit (
|
||||
for (Count = 0; Count < LocalityCount; Count++) {
|
||||
for (Index = 0; Index < LocalityCount; Index++) {
|
||||
// Element[x][x] must be equal to 10
|
||||
if ((Count == Index) && (SLIT_ELEMENT (LocalityPtr, Count,Index) != 10)) {
|
||||
if ((Count == Index) && (SLIT_ELEMENT (LocalityPtr, Count, Index) != 10)) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Diagonal Element[0x%lx][0x%lx] (%3d)."
|
||||
L" Normalized Value is not 10\n",
|
||||
L" Normalized Value is not 10\n",
|
||||
Count,
|
||||
Index,
|
||||
SLIT_ELEMENT (LocalityPtr, Count, Index)
|
||||
);
|
||||
}
|
||||
|
||||
// Element[i][j] must be equal to Element[j][i]
|
||||
if (SLIT_ELEMENT (LocalityPtr, Count, Index) !=
|
||||
SLIT_ELEMENT (LocalityPtr, Index, Count)) {
|
||||
SLIT_ELEMENT (LocalityPtr, Index, Count))
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Relative distances for Element[0x%lx][0x%lx] (%3d) and \n"
|
||||
L"Element[0x%lx][0x%lx] (%3d) do not match.\n",
|
||||
L"Element[0x%lx][0x%lx] (%3d) do not match.\n",
|
||||
Count,
|
||||
Index,
|
||||
SLIT_ELEMENT (LocalityPtr, Count, Index),
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/**
|
||||
This function validates the Interrupt Type.
|
||||
@ -29,24 +29,26 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateInterruptType (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
UINT8 InterruptType;
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
UINT8 InterruptType;
|
||||
|
||||
InterruptType = *Ptr;
|
||||
|
||||
if (InterruptType !=
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC) {
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)
|
||||
{
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"\nERROR: InterruptType = %d. This must be 8 on ARM Platforms",
|
||||
InterruptType
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,12 +62,12 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ValidateIrq (
|
||||
IN UINT8* Ptr,
|
||||
IN VOID* Context
|
||||
IN UINT8 *Ptr,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
UINT8 Irq;
|
||||
#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
|
||||
UINT8 Irq;
|
||||
|
||||
Irq = *Ptr;
|
||||
|
||||
@ -76,35 +78,36 @@ ValidateIrq (
|
||||
Irq
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
An ACPI_PARSER array describing the ACPI SPCR Table.
|
||||
**/
|
||||
STATIC CONST ACPI_PARSER SpcrParser[] = {
|
||||
STATIC CONST ACPI_PARSER SpcrParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo),
|
||||
{L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 3, 37, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},
|
||||
{L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL},
|
||||
{L"Interrupt Type", 1, 52, L"%d", NULL, NULL, ValidateInterruptType, NULL},
|
||||
{L"IRQ", 1, 53, L"%d", NULL, NULL, ValidateIrq, NULL},
|
||||
{L"Global System Interrupt", 4, 54, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Baud Rate", 1, 58, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Parity", 1, 59, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Stop Bits", 1, 60, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Flow Control", 1, 61, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Terminal Type", 1, 62, L"%d", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 1, 63, L"%x", NULL, NULL, NULL, NULL},
|
||||
{ L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 3, 37, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
|
||||
{ L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL },
|
||||
{ L"Interrupt Type", 1, 52, L"%d", NULL, NULL, ValidateInterruptType, NULL },
|
||||
{ L"IRQ", 1, 53, L"%d", NULL, NULL, ValidateIrq, NULL },
|
||||
{ L"Global System Interrupt", 4, 54, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Baud Rate", 1, 58, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Parity", 1, 59, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Stop Bits", 1, 60, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Flow Control", 1, 61, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Terminal Type", 1, 62, L"%d", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 1, 63, L"%x", NULL, NULL, NULL, NULL },
|
||||
|
||||
{L"PCI Device ID", 2, 64, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Vendor ID", 2, 66, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Bus Number", 1, 68, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Device Number", 1, 69, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Function Number", 1, 70, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Flags", 4, 71, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"PCI Segment", 1, 75, L"0x%x", NULL, NULL, NULL, NULL},
|
||||
{L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL}
|
||||
{ L"PCI Device ID", 2, 64, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Vendor ID", 2, 66, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Bus Number", 1, 68, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Device Number", 1, 69, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Function Number", 1, 70, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Flags", 4, 71, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"PCI Segment", 1, 75, L"0x%x", NULL, NULL, NULL, NULL },
|
||||
{ L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -122,10 +125,10 @@ STATIC CONST ACPI_PARSER SpcrParser[] = {
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiSpcr (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (!Trace) {
|
||||
|
@ -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},
|
||||
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}
|
||||
{ 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},
|
||||
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}
|
||||
{ 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},
|
||||
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}
|
||||
{ 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},
|
||||
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}
|
||||
{ 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},
|
||||
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}
|
||||
{ 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
|
||||
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;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -28,10 +28,10 @@
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiSsdt (
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8* Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
IN BOOLEAN Trace,
|
||||
IN UINT8 *Ptr,
|
||||
IN UINT32 AcpiTableLength,
|
||||
IN UINT8 AcpiTableRevision
|
||||
)
|
||||
{
|
||||
if (!Trace) {
|
||||
|
@ -15,11 +15,11 @@
|
||||
#include "AcpiTableParser.h"
|
||||
|
||||
// Local variables
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
|
||||
|
||||
/** An ACPI_PARSER array describing the ACPI XSDT table.
|
||||
*/
|
||||
STATIC CONST ACPI_PARSER XsdtParser[] = {
|
||||
STATIC CONST ACPI_PARSER XsdtParser[] = {
|
||||
PARSE_ACPI_HEADER (&AcpiHdrInfo)
|
||||
};
|
||||
|
||||
@ -30,7 +30,7 @@ CONST ACPI_DESCRIPTION_HEADER_INFO *
|
||||
EFIAPI
|
||||
GetAcpiXsdtHeaderInfo (
|
||||
VOID
|
||||
)
|
||||
)
|
||||
{
|
||||
return &AcpiHdrInfo;
|
||||
}
|
||||
@ -48,17 +48,17 @@ GetAcpiXsdtHeaderInfo (
|
||||
VOID
|
||||
EFIAPI
|
||||
ParseAcpiXsdt (
|
||||
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;
|
||||
UINT32 TableOffset;
|
||||
UINT64* TablePointer;
|
||||
UINTN EntryIndex;
|
||||
CHAR16 Buffer[32];
|
||||
UINT32 Offset;
|
||||
UINT32 TableOffset;
|
||||
UINT64 *TablePointer;
|
||||
UINTN EntryIndex;
|
||||
CHAR16 Buffer[32];
|
||||
|
||||
Offset = ParseAcpi (
|
||||
Trace,
|
||||
@ -72,24 +72,24 @@ ParseAcpiXsdt (
|
||||
TableOffset = Offset;
|
||||
|
||||
if (Trace) {
|
||||
EntryIndex = 0;
|
||||
TablePointer = (UINT64*)(Ptr + TableOffset);
|
||||
EntryIndex = 0;
|
||||
TablePointer = (UINT64 *)(Ptr + TableOffset);
|
||||
while (Offset < AcpiTableLength) {
|
||||
CONST UINT32* Signature;
|
||||
CONST UINT32* Length;
|
||||
CONST UINT8* Revision;
|
||||
CONST UINT32 *Signature;
|
||||
CONST UINT32 *Length;
|
||||
CONST UINT8 *Revision;
|
||||
|
||||
if ((UINT64*)(UINTN)(*TablePointer) != NULL) {
|
||||
UINT8* SignaturePtr;
|
||||
if ((UINT64 *)(UINTN)(*TablePointer) != NULL) {
|
||||
UINT8 *SignaturePtr;
|
||||
|
||||
ParseAcpiHeader (
|
||||
(UINT8*)(UINTN)(*TablePointer),
|
||||
(UINT8 *)(UINTN)(*TablePointer),
|
||||
&Signature,
|
||||
&Length,
|
||||
&Revision
|
||||
);
|
||||
|
||||
SignaturePtr = (UINT8*)Signature;
|
||||
SignaturePtr = (UINT8 *)Signature;
|
||||
|
||||
UnicodeSPrint (
|
||||
Buffer,
|
||||
@ -114,7 +114,7 @@ ParseAcpiXsdt (
|
||||
Print (L"0x%lx\n", *TablePointer);
|
||||
|
||||
// Validate the table pointers are not NULL
|
||||
if ((UINT64*)(UINTN)(*TablePointer) == NULL) {
|
||||
if ((UINT64 *)(UINTN)(*TablePointer) == NULL) {
|
||||
IncrementErrorCount ();
|
||||
Print (
|
||||
L"ERROR: Invalid table entry at 0x%lx, table address is 0x%lx\n",
|
||||
@ -122,18 +122,20 @@ ParseAcpiXsdt (
|
||||
*TablePointer
|
||||
);
|
||||
}
|
||||
|
||||
Offset += sizeof (UINT64);
|
||||
TablePointer++;
|
||||
} // while
|
||||
}
|
||||
|
||||
// Process the tables
|
||||
Offset = TableOffset;
|
||||
TablePointer = (UINT64*)(Ptr + TableOffset);
|
||||
Offset = TableOffset;
|
||||
TablePointer = (UINT64 *)(Ptr + TableOffset);
|
||||
while (Offset < AcpiTableLength) {
|
||||
if ((UINT64*)(UINTN)(*TablePointer) != NULL) {
|
||||
ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer));
|
||||
if ((UINT64 *)(UINTN)(*TablePointer) != NULL) {
|
||||
ProcessAcpiTable ((UINT8 *)(UINTN)(*TablePointer));
|
||||
}
|
||||
|
||||
Offset += sizeof (UINT64);
|
||||
TablePointer++;
|
||||
} // while
|
||||
|
Reference in New Issue
Block a user