ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues

Make the function comments follow EDK2 coding style.

Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Evan Lloyd <evan.lloyd@arm.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Dandan Bi
2018-06-04 09:14:51 +08:00
committed by Eric Dong
parent 64285f1526
commit a6eaba4d7f
22 changed files with 645 additions and 447 deletions

View File

@ -1,4 +1,4 @@
/** /** @file
ACPI parser ACPI parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -21,8 +21,9 @@ STATIC UINT32 gIndent;
STATIC UINT32 mTableErrorCount; STATIC UINT32 mTableErrorCount;
STATIC UINT32 mTableWarningCount; STATIC UINT32 mTableWarningCount;
/** This function resets the ACPI table error counter to Zero. /**
*/ This function resets the ACPI table error counter to Zero.
**/
VOID VOID
ResetErrorCount ( ResetErrorCount (
VOID VOID
@ -31,10 +32,11 @@ ResetErrorCount (
mTableErrorCount = 0; mTableErrorCount = 0;
} }
/** This function returns the ACPI table error count. /**
This function returns the ACPI table error count.
@retval Returns the count of errors detected in the ACPI tables. @retval Returns the count of errors detected in the ACPI tables.
*/ **/
UINT32 UINT32
GetErrorCount ( GetErrorCount (
VOID VOID
@ -43,8 +45,9 @@ GetErrorCount (
return mTableErrorCount; return mTableErrorCount;
} }
/** This function resets the ACPI table warning counter to Zero. /**
*/ This function resets the ACPI table warning counter to Zero.
**/
VOID VOID
ResetWarningCount ( ResetWarningCount (
VOID VOID
@ -53,10 +56,11 @@ ResetWarningCount (
mTableWarningCount = 0; mTableWarningCount = 0;
} }
/** This function returns the ACPI table warning count. /**
This function returns the ACPI table warning count.
@retval Returns the count of warning detected in the ACPI tables. @retval Returns the count of warning detected in the ACPI tables.
*/ **/
UINT32 UINT32
GetWarningCount ( GetWarningCount (
VOID VOID
@ -65,8 +69,9 @@ GetWarningCount (
return mTableWarningCount; return mTableWarningCount;
} }
/** This function increments the ACPI table error counter. /**
*/ This function increments the ACPI table error counter.
**/
VOID VOID
EFIAPI EFIAPI
IncrementErrorCount ( IncrementErrorCount (
@ -76,8 +81,9 @@ IncrementErrorCount (
mTableErrorCount++; mTableErrorCount++;
} }
/** This function increments the ACPI table warning counter. /**
*/ This function increments the ACPI table warning counter.
**/
VOID VOID
EFIAPI EFIAPI
IncrementWarningCount ( IncrementWarningCount (
@ -87,7 +93,8 @@ IncrementWarningCount (
mTableWarningCount++; mTableWarningCount++;
} }
/** This function verifies the ACPI table checksum. /**
This function verifies the ACPI table checksum.
This function verifies the checksum for the ACPI table and optionally This function verifies the checksum for the ACPI table and optionally
prints the status. prints the status.
@ -98,7 +105,7 @@ IncrementWarningCount (
@retval TRUE The checksum is OK. @retval TRUE The checksum is OK.
@retval FALSE The checksum failed. @retval FALSE The checksum failed.
*/ **/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
VerifyChecksum ( VerifyChecksum (
@ -146,11 +153,12 @@ VerifyChecksum (
return (Checksum == 0); return (Checksum == 0);
} }
/** This function performs a raw data dump of the ACPI table. /**
This function performs a raw data dump of the ACPI table.
@param [in] Ptr Pointer to the start of the table buffer. @param [in] Ptr Pointer to the start of the table buffer.
@param [in] Length The length of the buffer. @param [in] Length The length of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpRaw ( DumpRaw (
@ -205,12 +213,12 @@ DumpRaw (
Print (L" %a", AsciiBuffer); Print (L" %a", AsciiBuffer);
} }
/** This function traces 1 byte of data as specified in the /**
format string. This function traces 1 byte of data as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint8 ( DumpUint8 (
@ -221,12 +229,12 @@ DumpUint8 (
Print (Format, *Ptr); Print (Format, *Ptr);
} }
/** This function traces 2 bytes of data as specified in the /**
format string. This function traces 2 bytes of data as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint16 ( DumpUint16 (
@ -237,12 +245,12 @@ DumpUint16 (
Print (Format, *(UINT16*)Ptr); Print (Format, *(UINT16*)Ptr);
} }
/** This function traces 4 bytes of data as specified in the /**
format string. This function traces 4 bytes of data as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint32 ( DumpUint32 (
@ -253,12 +261,12 @@ DumpUint32 (
Print (Format, *(UINT32*)Ptr); Print (Format, *(UINT32*)Ptr);
} }
/** This function traces 8 bytes of data as specified by the /**
format string. This function traces 8 bytes of data as specified by the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint64 ( DumpUint64 (
@ -276,14 +284,15 @@ DumpUint64 (
Print (Format, Val); Print (Format, Val);
} }
/** This function traces 3 characters which can be optionally /**
formated using the format string if specified. This function traces 3 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump3Chars ( Dump3Chars (
@ -299,14 +308,15 @@ Dump3Chars (
); );
} }
/** This function traces 4 characters which can be optionally /**
formated using the format string if specified. This function traces 4 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump4Chars ( Dump4Chars (
@ -323,14 +333,15 @@ Dump4Chars (
); );
} }
/** This function traces 6 characters which can be optionally /**
formated using the format string if specified. This function traces 6 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump6Chars ( Dump6Chars (
@ -349,14 +360,15 @@ Dump6Chars (
); );
} }
/** This function traces 8 characters which can be optionally /**
formated using the format string if specified. This function traces 8 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump8Chars ( Dump8Chars (
@ -377,7 +389,8 @@ Dump8Chars (
); );
} }
/** This function indents and prints the ACPI table Field Name. /**
This function indents and prints the ACPI table Field Name.
@param [in] Indent Number of spaces to add to the global table indent. @param [in] Indent Number of spaces to add to the global table indent.
The global table indent is 0 by default; however The global table indent is 0 by default; however
@ -387,7 +400,7 @@ Dump8Chars (
Therefore the total indent in the output is Therefore the total indent in the output is
dependent on from where this function is called. dependent on from where this function is called.
@param [in] FieldName Pointer to the Field Name. @param [in] FieldName Pointer to the Field Name.
*/ **/
VOID VOID
EFIAPI EFIAPI
PrintFieldName ( PrintFieldName (
@ -404,7 +417,8 @@ PrintFieldName (
); );
} }
/** This function is used to parse an ACPI table buffer. /**
This function is used to parse an ACPI table buffer.
The ACPI table buffer is parsed using the ACPI table parser information The ACPI table buffer is parsed using the ACPI table parser information
specified by a pointer to an array of ACPI_PARSER elements. This parser specified by a pointer to an array of ACPI_PARSER elements. This parser
@ -428,7 +442,7 @@ PrintFieldName (
@param [in] ParserItems Number of items in the ACPI_PARSER array. @param [in] ParserItems Number of items in the ACPI_PARSER array.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
ParseAcpi ( ParseAcpi (
@ -540,10 +554,11 @@ ParseAcpi (
return Offset; return Offset;
} }
/** An array describing the ACPI Generic Address Structure. /**
An array describing the ACPI Generic Address Structure.
The GasParser array is used by the ParseAcpi function to parse and/or trace The GasParser array is used by the ParseAcpi function to parse and/or trace
the GAS structure. the GAS structure.
*/ **/
STATIC CONST ACPI_PARSER GasParser[] = { STATIC CONST ACPI_PARSER GasParser[] = {
{L"Address Space ID", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Address Space ID", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Register Bit Width", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Register Bit Width", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -552,12 +567,12 @@ STATIC CONST ACPI_PARSER GasParser[] = {
{L"Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL} {L"Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL}
}; };
/** This function indents and traces the GAS structure as described /**
by the GasParser. This function indents and traces the GAS structure as described by the GasParser.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Indent Number of spaces to indent the output. @param [in] Indent Number of spaces to indent the output.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpGasStruct ( DumpGasStruct (
@ -576,11 +591,12 @@ DumpGasStruct (
); );
} }
/** This function traces the GAS structure as described by the GasParser. /**
This function traces the GAS structure as described by the GasParser.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpGas ( DumpGas (
@ -591,12 +607,13 @@ DumpGas (
DumpGasStruct (Ptr, 2); DumpGasStruct (Ptr, 2);
} }
/** This function traces the ACPI header as described by the AcpiHeaderParser. /**
This function traces the ACPI header as described by the AcpiHeaderParser.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
DumpAcpiHeader ( DumpAcpiHeader (
@ -618,7 +635,8 @@ DumpAcpiHeader (
); );
} }
/** This function parses the ACPI header as described by the AcpiHeaderParser. /**
This function parses the ACPI header as described by the AcpiHeaderParser.
This function optionally returns the signature, length and revision of the This function optionally returns the signature, length and revision of the
ACPI table. ACPI table.
@ -629,7 +647,7 @@ DumpAcpiHeader (
@param [out] Revision Gets location of the revision of the ACPI table. @param [out] Revision Gets location of the revision of the ACPI table.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
ParseAcpiHeader ( ParseAcpiHeader (

View File

@ -1,4 +1,4 @@
/** /** @file
Header file for ACPI parser Header file for ACPI parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -22,23 +22,26 @@
/// that allows us to process the log options. /// that allows us to process the log options.
#define RSDP_TABLE_INFO SIGNATURE_32('R', 'S', 'D', 'P') #define RSDP_TABLE_INFO SIGNATURE_32('R', 'S', 'D', 'P')
/** This function increments the ACPI table error counter. /**
*/ This function increments the ACPI table error counter.
**/
VOID VOID
EFIAPI EFIAPI
IncrementErrorCount ( IncrementErrorCount (
VOID VOID
); );
/** This function increments the ACPI table warning counter. /**
*/ This function increments the ACPI table warning counter.
**/
VOID VOID
EFIAPI EFIAPI
IncrementWarningCount ( IncrementWarningCount (
VOID VOID
); );
/** This function verifies the ACPI table checksum. /**
This function verifies the ACPI table checksum.
This function verifies the checksum for the ACPI table and optionally This function verifies the checksum for the ACPI table and optionally
prints the status. prints the status.
@ -49,7 +52,7 @@ IncrementWarningCount (
@retval TRUE The checksum is OK. @retval TRUE The checksum is OK.
@retval FALSE The checksum failed. @retval FALSE The checksum failed.
*/ **/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
VerifyChecksum ( VerifyChecksum (
@ -58,11 +61,12 @@ VerifyChecksum (
IN UINT32 Length IN UINT32 Length
); );
/** This function performs a raw data dump of the ACPI table. /**
This function performs a raw data dump of the ACPI table.
@param [in] Ptr Pointer to the start of the table buffer. @param [in] Ptr Pointer to the start of the table buffer.
@param [in] Length The length of the buffer. @param [in] Length The length of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpRaw ( DumpRaw (
@ -70,12 +74,12 @@ DumpRaw (
IN UINT32 Length IN UINT32 Length
); );
/** This function traces 1 byte of datum as specified in the /**
format string. This function traces 1 byte of datum as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint8 ( DumpUint8 (
@ -83,12 +87,12 @@ DumpUint8 (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 2 bytes of data as specified in the /**
format string. This function traces 2 bytes of data as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint16 ( DumpUint16 (
@ -96,12 +100,12 @@ DumpUint16 (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 4 bytes of data as specified in the /**
format string. This function traces 4 bytes of data as specified in the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint32 ( DumpUint32 (
@ -109,12 +113,12 @@ DumpUint32 (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 8 bytes of data as specified by the /**
format string. This function traces 8 bytes of data as specified by the format string.
@param [in] Format The format string for tracing the data. @param [in] Format The format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpUint64 ( DumpUint64 (
@ -122,14 +126,15 @@ DumpUint64 (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 3 characters which can be optionally /**
formated using the format string if specified. This function traces 3 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump3Chars ( Dump3Chars (
@ -137,14 +142,15 @@ Dump3Chars (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 4 characters which can be optionally /**
formated using the format string if specified. This function traces 4 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump4Chars ( Dump4Chars (
@ -152,14 +158,15 @@ Dump4Chars (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 6 characters which can be optionally /**
formated using the format string if specified. This function traces 6 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump6Chars ( Dump6Chars (
@ -167,14 +174,15 @@ Dump6Chars (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces 8 characters which can be optionally /**
formated using the format string if specified. This function traces 8 characters which can be optionally
formated using the format string if specified.
If no format string is specified the Format must be NULL. If no format string is specified the Format must be NULL.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
Dump8Chars ( Dump8Chars (
@ -182,7 +190,8 @@ Dump8Chars (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function indents and prints the ACPI table Field Name. /**
This function indents and prints the ACPI table Field Name.
@param [in] Indent Number of spaces to add to the global table @param [in] Indent Number of spaces to add to the global table
indent. The global table indent is 0 by default; indent. The global table indent is 0 by default;
@ -192,33 +201,36 @@ Dump8Chars (
the total indent in the output is dependent on from the total indent in the output is dependent on from
where this function is called. where this function is called.
@param [in] FieldName Pointer to the Field Name. @param [in] FieldName Pointer to the Field Name.
*/ **/
VOID VOID
EFIAPI EFIAPI
PrintFieldName ( PrintFieldName (
IN UINT32 Indent, IN UINT32 Indent,
IN CONST CHAR16* FieldName IN CONST CHAR16* FieldName
); );
/** This function pointer is the template for customizing the trace output /**
This function pointer is the template for customizing the trace output
@param [in] Format Format string for tracing the data as specified by @param [in] Format Format string for tracing the data as specified by
the 'Format' member of ACPI_PARSER. the 'Format' member of ACPI_PARSER.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16* Format, UINT8* Ptr); typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16* Format, UINT8* Ptr);
/** This function pointer is the template for validating an ACPI table field. /**
This function pointer is the template for validating an ACPI table field.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information as specified by @param [in] Context Pointer to context specific information as specified by
the 'Context' member of the ACPI_PARSER. the 'Context' member of the ACPI_PARSER.
e.g. this could be a pointer to the ACPI table header. e.g. this could be a pointer to the ACPI table header.
*/ **/
typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context); typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context);
/** The ACPI_PARSER structure describes the fields of an ACPI table and /**
provides means for the parser to interpret and trace appropriately. The ACPI_PARSER structure describes the fields of an ACPI table and
provides means for the parser to interpret and trace appropriately.
The first three members are populated based on information present in The first three members are populated based on information present in
in the ACPI table specifications. The remaining members describe how in the ACPI table specifications. The remaining members describe how
@ -234,7 +246,7 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context);
The 'Format' and 'PrintFormatter' members allow flexibility for The 'Format' and 'PrintFormatter' members allow flexibility for
representing the field data. representing the field data.
*/ **/
typedef struct AcpiParser { typedef struct AcpiParser {
/// String describing the ACPI table field /// String describing the ACPI table field
@ -278,9 +290,10 @@ typedef struct AcpiParser {
VOID* Context; VOID* Context;
} ACPI_PARSER; } ACPI_PARSER;
/** A structure used to store the pointers to the members of the /**
ACPI description header structure that was parsed. A structure used to store the pointers to the members of the
*/ ACPI description header structure that was parsed.
**/
typedef struct AcpiDescriptionHeaderInfo { typedef struct AcpiDescriptionHeaderInfo {
/// ACPI table signature /// ACPI table signature
UINT32* Signature; UINT32* Signature;
@ -302,7 +315,8 @@ typedef struct AcpiDescriptionHeaderInfo {
UINT32* CreatorRevision; UINT32* CreatorRevision;
} ACPI_DESCRIPTION_HEADER_INFO; } ACPI_DESCRIPTION_HEADER_INFO;
/** This function is used to parse an ACPI table buffer. /**
This function is used to parse an ACPI table buffer.
The ACPI table buffer is parsed using the ACPI table parser information The ACPI table buffer is parsed using the ACPI table parser information
specified by a pointer to an array of ACPI_PARSER elements. This parser specified by a pointer to an array of ACPI_PARSER elements. This parser
@ -326,7 +340,7 @@ typedef struct AcpiDescriptionHeaderInfo {
@param [in] ParserItems Number of items in the ACPI_PARSER array. @param [in] ParserItems Number of items in the ACPI_PARSER array.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
ParseAcpi ( ParseAcpi (
@ -337,19 +351,21 @@ ParseAcpi (
IN UINT32 Length, IN UINT32 Length,
IN CONST ACPI_PARSER* Parser, IN CONST ACPI_PARSER* Parser,
IN UINT32 ParserItems IN UINT32 ParserItems
); );
/** This is a helper macro to pass parameters to the Parser functions. /**
This is a helper macro to pass parameters to the Parser functions.
@param [in] Parser The name of the ACPI_PARSER array describing the @param [in] Parser The name of the ACPI_PARSER array describing the
ACPI table fields. ACPI table fields.
*/ **/
#define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0]) #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])
/** This is a helper macro for describing the ACPI header fields. /**
This is a helper macro for describing the ACPI header fields.
@param [out] Info Pointer to retrieve the ACPI table header information. @param [out] Info Pointer to retrieve the ACPI table header information.
*/ **/
#define PARSE_ACPI_HEADER(Info) \ #define PARSE_ACPI_HEADER(Info) \
{ L"Signature", 4, 0, NULL, Dump4Chars, \ { L"Signature", 4, 0, NULL, Dump4Chars, \
(VOID**)&(Info)->Signature , NULL, NULL }, \ (VOID**)&(Info)->Signature , NULL, NULL }, \
@ -370,30 +386,32 @@ ParseAcpi (
{ L"Creator Revision", 4, 32, L"0x%X", NULL, \ { L"Creator Revision", 4, 32, L"0x%X", NULL, \
(VOID**)&(Info)->CreatorRevision, NULL, NULL } (VOID**)&(Info)->CreatorRevision, NULL, NULL }
/** Length of the ACPI GAS structure. /**
Length of the ACPI GAS structure.
NOTE: This might normally be defined as NOTE: This might normally be defined as
sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE). sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).
However, we deliberately minimise any reference to the EDK2 ACPI However, we deliberately minimise any reference to the EDK2 ACPI
headers in an attempt to provide cross checking. headers in an attempt to provide cross checking.
*/ **/
#define GAS_LENGTH 12 #define GAS_LENGTH 12
/** Length of the ACPI Header structure. /**
Length of the ACPI Header structure.
NOTE: This might normally be defined as NOTE: This might normally be defined as
sizeof (EFI_ACPI_DESCRIPTION_HEADER). sizeof (EFI_ACPI_DESCRIPTION_HEADER).
However, we deliberately minimise any reference to the EDK2 ACPI However, we deliberately minimise any reference to the EDK2 ACPI
headers in an attempt to provide cross checking. headers in an attempt to provide cross checking.
*/ **/
#define ACPI_DESCRIPTION_HEADER_LENGTH 36 #define ACPI_DESCRIPTION_HEADER_LENGTH 36
/** This function indents and traces the GAS structure as described /**
by the GasParser. This function indents and traces the GAS structure as described by the GasParser.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Indent Number of spaces to indent the output. @param [in] Indent Number of spaces to indent the output.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpGasStruct ( DumpGasStruct (
@ -401,11 +419,12 @@ DumpGasStruct (
IN UINT32 Indent IN UINT32 Indent
); );
/** This function traces the GAS structure as described by the GasParser. /**
This function traces the GAS structure as described by the GasParser.
@param [in] Format Optional format string for tracing the data. @param [in] Format Optional format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
DumpGas ( DumpGas (
@ -413,19 +432,21 @@ DumpGas (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function traces the ACPI header as described by the AcpiHeaderParser. /**
This function traces the ACPI header as described by the AcpiHeaderParser.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
DumpAcpiHeader ( DumpAcpiHeader (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** This function parses the ACPI header as described by the AcpiHeaderParser. /**
This function parses the ACPI header as described by the AcpiHeaderParser.
This function optionally returns the Signature, Length and revision of the This function optionally returns the Signature, Length and revision of the
ACPI table. ACPI table.
@ -436,7 +457,7 @@ DumpAcpiHeader (
@param [out] Revision Gets location of the revision of the ACPI table. @param [out] Revision Gets location of the revision of the ACPI table.
@retval Number of bytes parsed. @retval Number of bytes parsed.
*/ **/
UINT32 UINT32
EFIAPI EFIAPI
ParseAcpiHeader ( ParseAcpiHeader (
@ -446,7 +467,8 @@ ParseAcpiHeader (
OUT CONST UINT8** Revision OUT CONST UINT8** Revision
); );
/** This function parses the ACPI BGRT table. /**
This function parses the ACPI BGRT table.
When trace is enabled this function parses the BGRT table and When trace is enabled this function parses the BGRT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -456,7 +478,7 @@ ParseAcpiHeader (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiBgrt ( ParseAcpiBgrt (
@ -466,7 +488,8 @@ ParseAcpiBgrt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI DBG2 table. /**
This function parses the ACPI DBG2 table.
When trace is enabled this function parses the DBG2 table and When trace is enabled this function parses the DBG2 table and
traces the ACPI table fields. traces the ACPI table fields.
@ -476,7 +499,7 @@ ParseAcpiBgrt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiDbg2 ( ParseAcpiDbg2 (
@ -486,7 +509,8 @@ ParseAcpiDbg2 (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI DSDT table. /**
This function parses the ACPI DSDT table.
When trace is enabled this function parses the DSDT table and When trace is enabled this function parses the DSDT table and
traces the ACPI table fields. traces the ACPI table fields.
For the DSDT table only the ACPI header fields are parsed and For the DSDT table only the ACPI header fields are parsed and
@ -496,7 +520,7 @@ ParseAcpiDbg2 (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiDsdt ( ParseAcpiDsdt (
@ -506,7 +530,8 @@ ParseAcpiDsdt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI FADT table. /**
This function parses the ACPI FADT table.
This function parses the FADT table and optionally traces the ACPI This function parses the FADT table and optionally traces the ACPI
table fields. table fields.
@ -516,7 +541,7 @@ ParseAcpiDsdt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiFadt ( ParseAcpiFadt (
@ -526,7 +551,8 @@ ParseAcpiFadt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI GTDT table. /**
This function parses the ACPI GTDT table.
When trace is enabled this function parses the GTDT table and When trace is enabled this function parses the GTDT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -540,7 +566,7 @@ ParseAcpiFadt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiGtdt ( ParseAcpiGtdt (
@ -550,7 +576,8 @@ ParseAcpiGtdt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI IORT table. /**
This function parses the ACPI IORT table.
When trace is enabled this function parses the IORT table and When trace is enabled this function parses the IORT table and
traces the ACPI fields. traces the ACPI fields.
@ -568,7 +595,7 @@ ParseAcpiGtdt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiIort ( ParseAcpiIort (
@ -578,7 +605,8 @@ ParseAcpiIort (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI MADT table. /**
This function parses the ACPI MADT table.
When trace is enabled this function parses the MADT table and When trace is enabled this function parses the MADT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -596,7 +624,7 @@ ParseAcpiIort (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiMadt ( ParseAcpiMadt (
@ -606,7 +634,8 @@ ParseAcpiMadt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI MCFG table. /**
This function parses the ACPI MCFG table.
When trace is enabled this function parses the MCFG table and When trace is enabled this function parses the MCFG table and
traces the ACPI table fields. traces the ACPI table fields.
@ -616,7 +645,7 @@ ParseAcpiMadt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiMcfg ( ParseAcpiMcfg (
@ -626,7 +655,8 @@ ParseAcpiMcfg (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI RSDP table. /**
This function parses the ACPI RSDP table.
This function invokes the parser for the XSDT table. This function invokes the parser for the XSDT table.
* Note - This function does not support parsing of RSDT table. * Note - This function does not support parsing of RSDT table.
@ -638,7 +668,7 @@ ParseAcpiMcfg (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiRsdp ( ParseAcpiRsdp (
@ -648,7 +678,8 @@ ParseAcpiRsdp (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI SLIT table. /**
This function parses the ACPI SLIT table.
When trace is enabled this function parses the SLIT table and When trace is enabled this function parses the SLIT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -661,7 +692,7 @@ ParseAcpiRsdp (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSlit ( ParseAcpiSlit (
@ -671,7 +702,8 @@ ParseAcpiSlit (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI SPCR table. /**
This function parses the ACPI SPCR table.
When trace is enabled this function parses the SPCR table and When trace is enabled this function parses the SPCR table and
traces the ACPI table fields. traces the ACPI table fields.
@ -681,7 +713,7 @@ ParseAcpiSlit (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSpcr ( ParseAcpiSpcr (
@ -691,7 +723,8 @@ ParseAcpiSpcr (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI SRAT table. /**
This function parses the ACPI SRAT table.
When trace is enabled this function parses the SRAT table and When trace is enabled this function parses the SRAT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -707,7 +740,7 @@ ParseAcpiSpcr (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSrat ( ParseAcpiSrat (
@ -717,7 +750,8 @@ ParseAcpiSrat (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI SSDT table. /**
This function parses the ACPI SSDT table.
When trace is enabled this function parses the SSDT table and When trace is enabled this function parses the SSDT table and
traces the ACPI table fields. traces the ACPI table fields.
For the SSDT table only the ACPI header fields are For the SSDT table only the ACPI header fields are
@ -727,7 +761,7 @@ ParseAcpiSrat (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSsdt ( ParseAcpiSsdt (
@ -737,7 +771,8 @@ ParseAcpiSsdt (
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** This function parses the ACPI XSDT table /**
This function parses the ACPI XSDT table
and optionally traces the ACPI table fields. and optionally traces the ACPI table fields.
This function also performs validation of the XSDT table. This function also performs validation of the XSDT table.
@ -746,7 +781,7 @@ ParseAcpiSsdt (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiXsdt ( ParseAcpiXsdt (

View File

@ -1,4 +1,4 @@
/** /** @file
ACPI table parser ACPI table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -18,11 +18,13 @@
#include "AcpiTableParser.h" #include "AcpiTableParser.h"
#include "AcpiView.h" #include "AcpiView.h"
/** A list of registered ACPI table parsers. /**
*/ A list of registered ACPI table parsers.
**/
STATIC ACPI_TABLE_PARSER mTableParserList[MAX_ACPI_TABLE_PARSERS]; STATIC ACPI_TABLE_PARSER mTableParserList[MAX_ACPI_TABLE_PARSERS];
/** Register the ACPI table Parser /**
Register the ACPI table Parser
This function registers the ACPI table parser. This function registers the ACPI table parser.
@ -35,7 +37,7 @@ STATIC ACPI_TABLE_PARSER mTableParserList[MAX_ACPI_TABLE_PARSERS];
was already registered. was already registered.
@retval EFI_OUT_OF_RESOURCES No space to register the @retval EFI_OUT_OF_RESOURCES No space to register the
parser. parser.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
RegisterParser ( RegisterParser (
@ -77,7 +79,8 @@ RegisterParser (
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
/** Deregister the ACPI table Parser /**
Deregister the ACPI table Parser
This function deregisters the ACPI table parser. This function deregisters the ACPI table parser.
@ -86,7 +89,7 @@ RegisterParser (
@retval EFI_SUCCESS The parser was deregistered. @retval EFI_SUCCESS The parser was deregistered.
@retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND A registered parser was not found. @retval EFI_NOT_FOUND A registered parser was not found.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
DeregisterParser ( DeregisterParser (
@ -114,7 +117,8 @@ DeregisterParser (
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
/** Get the ACPI table Parser /**
Get the ACPI table Parser
This function returns the ACPI table parser proc from the list of This function returns the ACPI table parser proc from the list of
registered parsers. registered parsers.
@ -125,7 +129,7 @@ DeregisterParser (
@retval EFI_SUCCESS The parser was returned successfully. @retval EFI_SUCCESS The parser was returned successfully.
@retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND A registered parser was not found. @retval EFI_NOT_FOUND A registered parser was not found.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
GetParser ( GetParser (
@ -153,7 +157,8 @@ GetParser (
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
/** This function processes the ACPI tables. /**
This function processes the ACPI tables.
This function calls ProcessTableReportOptions() to list the ACPI This function calls ProcessTableReportOptions() to list the ACPI
tables, perform binary dump of the tables and determine if the tables, perform binary dump of the tables and determine if the
ACPI fields should be traced. ACPI fields should be traced.
@ -165,7 +170,7 @@ GetParser (
@param [in] Ptr Pointer to the start of the ACPI @param [in] Ptr Pointer to the start of the ACPI
table data buffer. table data buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
ProcessAcpiTable ( ProcessAcpiTable (

View File

@ -1,4 +1,4 @@
/** /** @file
Header file for ACPI table parser Header file for ACPI table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -14,7 +14,8 @@
#ifndef ACPITABLEPARSER_H_ #ifndef ACPITABLEPARSER_H_
#define ACPITABLEPARSER_H_ #define ACPITABLEPARSER_H_
/** The maximum number of ACPI table parsers. /**
The maximum number of ACPI table parsers.
*/ */
#define MAX_ACPI_TABLE_PARSERS 16 #define MAX_ACPI_TABLE_PARSERS 16
@ -22,13 +23,14 @@
*/ */
#define ACPI_PARSER_SIGNATURE_NULL 0 #define ACPI_PARSER_SIGNATURE_NULL 0
/** A function that parses the ACPI table. /**
A function that parses the ACPI table.
@param [in] Trace If TRUE, trace the ACPI fields. @param [in] Trace If TRUE, trace the ACPI fields.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
typedef typedef
VOID VOID
(EFIAPI * PARSE_ACPI_TABLE_PROC) ( (EFIAPI * PARSE_ACPI_TABLE_PROC) (
@ -38,8 +40,9 @@ VOID
IN UINT8 AcpiTableRevision IN UINT8 AcpiTableRevision
); );
/** The ACPI table parser information /**
*/ The ACPI table parser information
**/
typedef struct AcpiTableParser { typedef struct AcpiTableParser {
/// ACPI table signature /// ACPI table signature
UINT32 Signature; UINT32 Signature;
@ -48,7 +51,8 @@ typedef struct AcpiTableParser {
PARSE_ACPI_TABLE_PROC Parser; PARSE_ACPI_TABLE_PROC Parser;
} ACPI_TABLE_PARSER; } ACPI_TABLE_PARSER;
/** Register the ACPI table Parser /**
Register the ACPI table Parser
This function registers the ACPI table parser. This function registers the ACPI table parser.
@ -61,15 +65,16 @@ typedef struct AcpiTableParser {
was already registered. was already registered.
@retval EFI_OUT_OF_RESOURCES No space to register the @retval EFI_OUT_OF_RESOURCES No space to register the
parser. parser.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
RegisterParser ( RegisterParser (
IN UINT32 Signature, IN UINT32 Signature,
IN PARSE_ACPI_TABLE_PROC ParserProc IN PARSE_ACPI_TABLE_PROC ParserProc
); );
/** Deregister the ACPI table Parser /**
Deregister the ACPI table Parser
This function deregisters the ACPI table parser. This function deregisters the ACPI table parser.
@ -78,14 +83,15 @@ RegisterParser (
@retval EFI_SUCCESS The parser was deregistered. @retval EFI_SUCCESS The parser was deregistered.
@retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND A registered parser was not found. @retval EFI_NOT_FOUND A registered parser was not found.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
DeregisterParser ( DeregisterParser (
IN UINT32 Signature IN UINT32 Signature
); );
/** This function processes the ACPI tables. /**
This function processes the ACPI tables.
This function calls ProcessTableReportOptions() to list the ACPI This function calls ProcessTableReportOptions() to list the ACPI
tables, perform binary dump of the tables and determine if the tables, perform binary dump of the tables and determine if the
ACPI fields should be traced. ACPI fields should be traced.
@ -97,14 +103,15 @@ DeregisterParser (
@param [in] Ptr Pointer to the start of the ACPI @param [in] Ptr Pointer to the start of the ACPI
table data buffer. table data buffer.
*/ **/
VOID VOID
EFIAPI EFIAPI
ProcessAcpiTable ( ProcessAcpiTable (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** Get the ACPI table Parser /**
Get the ACPI table Parser
This function returns the ACPI table parser proc from the list of This function returns the ACPI table parser proc from the list of
registered parsers. registered parsers.
@ -115,7 +122,7 @@ ProcessAcpiTable (
@retval EFI_SUCCESS The parser was returned successfully. @retval EFI_SUCCESS The parser was returned successfully.
@retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND A registered parser was not found. @retval EFI_NOT_FOUND A registered parser was not found.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
GetParser ( GetParser (

View File

@ -1,4 +1,4 @@
/** /** @file
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
This program and the accompanying materials This program and the accompanying materials
@ -35,8 +35,9 @@ STATIC BOOLEAN mVerbose;
STATIC BOOLEAN mConsistencyCheck; STATIC BOOLEAN mConsistencyCheck;
STATIC BOOLEAN mColourHighlighting; STATIC BOOLEAN mColourHighlighting;
/** An array of acpiview command line parameters. /**
*/ An array of acpiview command line parameters.
**/
STATIC CONST SHELL_PARAM_ITEM ParamList[] = { STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{L"/?", TypeFlag}, {L"/?", TypeFlag},
{L"-c", TypeFlag}, {L"-c", TypeFlag},
@ -48,10 +49,11 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{NULL, TypeMax} {NULL, TypeMax}
}; };
/** This function returns the colour highlighting status. /**
This function returns the colour highlighting status.
@retval TRUE if colour highlighting is enabled. @retval TRUE if colour highlighting is enabled.
*/ **/
BOOLEAN BOOLEAN
GetColourHighlighting ( GetColourHighlighting (
VOID VOID
@ -60,9 +62,12 @@ GetColourHighlighting (
return mColourHighlighting; return mColourHighlighting;
} }
/** This function sets the colour highlighting status. /**
This function sets the colour highlighting status.
*/ @param Highlight The Highlight status.
**/
VOID VOID
SetColourHighlighting ( SetColourHighlighting (
BOOLEAN Highlight BOOLEAN Highlight
@ -71,10 +76,11 @@ SetColourHighlighting (
mColourHighlighting = Highlight; mColourHighlighting = Highlight;
} }
/** This function returns the report options. /**
This function returns the report options.
@retval Returns the report option. @retval Returns the report option.
*/ **/
STATIC STATIC
EREPORT_OPTION EREPORT_OPTION
GetReportOption ( GetReportOption (
@ -84,10 +90,11 @@ GetReportOption (
return mReportType; return mReportType;
} }
/** This function returns the selected ACPI table. /**
This function returns the selected ACPI table.
@retval Returns signature of the selected ACPI table. @retval Returns signature of the selected ACPI table.
*/ **/
STATIC STATIC
UINT32 UINT32
GetSelectedAcpiTable ( GetSelectedAcpiTable (
@ -97,13 +104,15 @@ GetSelectedAcpiTable (
return mSelectedAcpiTable; return mSelectedAcpiTable;
} }
/** This function dumps the ACPI table to a file. /**
This function dumps the ACPI table to a file.
@param [in] Ptr Pointer to the ACPI table data. @param [in] Ptr Pointer to the ACPI table data.
@param [in] Length The length of the ACPI table. @param [in] Length The length of the ACPI table.
@retval TRUE Success. @retval TRUE Success.
@retval FALSE Failure. @retval FALSE Failure.
*/ **/
STATIC STATIC
BOOLEAN BOOLEAN
DumpAcpiTableToFile ( DumpAcpiTableToFile (
@ -160,14 +169,15 @@ DumpAcpiTableToFile (
return (Length == TransferBytes); return (Length == TransferBytes);
} }
/** This function processes the table reporting options for the ACPI table. /**
This function processes the table reporting options for the ACPI table.
@param [in] Signature The ACPI table Signature. @param [in] Signature The ACPI table Signature.
@param [in] TablePtr Pointer to the ACPI table data. @param [in] TablePtr Pointer to the ACPI table data.
@param [in] Length The length fo the ACPI table. @param [in] Length The length fo the ACPI table.
@retval Returns TRUE if the ACPI table should be traced. @retval Returns TRUE if the ACPI table should be traced.
*/ **/
BOOLEAN BOOLEAN
ProcessTableReportOptions ( ProcessTableReportOptions (
IN CONST UINT32 Signature, IN CONST UINT32 Signature,
@ -249,13 +259,14 @@ ProcessTableReportOptions (
return Log; return Log;
} }
/** This function converts a string to ACPI table signature. /**
This function converts a string to ACPI table signature.
@param [in] Str Pointer to the string to be converted to the @param [in] Str Pointer to the string to be converted to the
ACPI table signature. ACPI table signature.
@retval The ACPI table signature. @retval The ACPI table signature.
*/ **/
STATIC STATIC
UINT32 UINT32
ConvertStrToAcpiSignature ( ConvertStrToAcpiSignature (
@ -277,16 +288,16 @@ ConvertStrToAcpiSignature (
return *(UINT32*)Ptr; return *(UINT32*)Ptr;
} }
/** This function iterates the configuration table entries in the /**
system table, retrieves the RSDP pointer and starts parsing This function iterates the configuration table entries in the
the ACPI tables. system table, retrieves the RSDP pointer and starts parsing the ACPI tables.
@param [in] SystemTable Pointer to the EFI system table. @param [in] SystemTable Pointer to the EFI system table.
@retval Returns EFI_NOT_FOUND if the RSDP pointer is not found. @retval Returns EFI_NOT_FOUND if the RSDP pointer is not found.
Returns EFI_UNSUPPORTED if the RSDP version is less than 2. Returns EFI_UNSUPPORTED if the RSDP version is less than 2.
Returns EFI_SUCCESS if successful. Returns EFI_SUCCESS if successful.
*/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -406,7 +417,7 @@ AcpiView (
@param[in] ImageHandle Handle to the Image (NULL if Internal). @param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal). @param[in] SystemTable Pointer to the System Table (NULL if Internal).
*/ **/
SHELL_STATUS SHELL_STATUS
EFIAPI EFIAPI
ShellCommandRunAcpiView ( ShellCommandRunAcpiView (

View File

@ -1,4 +1,4 @@
/** /** @file
Header file for AcpiView Header file for AcpiView
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -14,20 +14,24 @@
#ifndef ACPIVIEW_H_ #ifndef ACPIVIEW_H_
#define ACPIVIEW_H_ #define ACPIVIEW_H_
/** A macro to define the max file name length /**
*/ A macro to define the max file name length
**/
#define MAX_FILE_NAME_LEN 128 #define MAX_FILE_NAME_LEN 128
/** Offset to the RSDP revision from the start of the RSDP /**
*/ Offset to the RSDP revision from the start of the RSDP
**/
#define RSDP_REVISION_OFFSET 15 #define RSDP_REVISION_OFFSET 15
/** Offset to the RSDP length from the start of the RSDP /**
*/ Offset to the RSDP length from the start of the RSDP
**/
#define RSDP_LENGTH_OFFSET 20 #define RSDP_LENGTH_OFFSET 20
/** The EREPORT_OPTION enum describes ACPI table Reporting options. /**
*/ The EREPORT_OPTION enum describes ACPI table Reporting options.
**/
typedef enum ReportOption { typedef enum ReportOption {
EREPORT_ALL, ///< Report All tables. EREPORT_ALL, ///< Report All tables.
EREPORT_SELECTED, ///< Report Selected table. EREPORT_SELECTED, ///< Report Selected table.
@ -36,63 +40,72 @@ typedef enum ReportOption {
EREPORT_MAX EREPORT_MAX
} EREPORT_OPTION; } EREPORT_OPTION;
/** This function resets the ACPI table error counter to Zero. /**
*/ This function resets the ACPI table error counter to Zero.
**/
VOID VOID
ResetErrorCount ( ResetErrorCount (
VOID VOID
); );
/** This function returns the ACPI table error count. /**
This function returns the ACPI table error count.
@retval Returns the count of errors detected in the ACPI tables. @retval Returns the count of errors detected in the ACPI tables.
*/ **/
UINT32 UINT32
GetErrorCount ( GetErrorCount (
VOID VOID
); );
/** This function resets the ACPI table warning counter to Zero. /**
*/ This function resets the ACPI table warning counter to Zero.
**/
VOID VOID
ResetWarningCount ( ResetWarningCount (
VOID VOID
); );
/** This function returns the ACPI table warning count. /**
This function returns the ACPI table warning count.
@retval Returns the count of warning detected in the ACPI tables. @retval Returns the count of warning detected in the ACPI tables.
*/ **/
UINT32 UINT32
GetWarningCount ( GetWarningCount (
VOID VOID
); );
/** This function returns the colour highlighting status. /**
This function returns the colour highlighting status.
@retval TRUE if colour highlighting is enabled. @retval TRUE if colour highlighting is enabled.
*/ **/
BOOLEAN BOOLEAN
GetColourHighlighting ( GetColourHighlighting (
VOID VOID
); );
/** This function sets the colour highlighting status. /**
This function sets the colour highlighting status.
*/ @param Highlight The Highlight status.
**/
VOID VOID
SetColourHighlighting ( SetColourHighlighting (
BOOLEAN Highlight BOOLEAN Highlight
); );
/** This function processes the table reporting options for the ACPI table. /**
This function processes the table reporting options for the ACPI table.
@param [in] Signature The ACPI table Signature. @param [in] Signature The ACPI table Signature.
@param [in] TablePtr Pointer to the ACPI table data. @param [in] TablePtr Pointer to the ACPI table data.
@param [in] Length The length fo the ACPI table. @param [in] Length The length fo the ACPI table.
@retval Returns TRUE if the ACPI table should be traced. @retval Returns TRUE if the ACPI table should be traced.
*/ **/
BOOLEAN BOOLEAN
ProcessTableReportOptions ( ProcessTableReportOptions (
IN CONST UINT32 Signature, IN CONST UINT32 Signature,

View File

@ -1,4 +1,4 @@
/** /** @file
BGRT table parser BGRT table parser
Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
@ -22,8 +22,9 @@
// Local variables // Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** An ACPI_PARSER array describing the ACPI BDRT Table. /**
*/ An ACPI_PARSER array describing the ACPI BDRT Table.
**/
STATIC CONST ACPI_PARSER BgrtParser[] = { STATIC CONST ACPI_PARSER BgrtParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL}, {L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL},
@ -34,7 +35,8 @@ STATIC CONST ACPI_PARSER BgrtParser[] = {
{L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL} {L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL}
}; };
/** This function parses the ACPI BGRT table. /**
This function parses the ACPI BGRT table.
When trace is enabled this function parses the BGRT table and When trace is enabled this function parses the BGRT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -44,7 +46,7 @@ STATIC CONST ACPI_PARSER BgrtParser[] = {
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiBgrt ( ParseAcpiBgrt (

View File

@ -1,4 +1,4 @@
/** /** @file
DBG2 table parser DBG2 table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -32,12 +32,13 @@ STATIC CONST UINT16* BaseAddrRegOffset;
STATIC CONST UINT16* AddrSizeOffset; STATIC CONST UINT16* AddrSizeOffset;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** This function Validates the NameSpace string length. /**
This function Validates the NameSpace string length.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -46,12 +47,13 @@ ValidateNameSpaceStrLen (
IN VOID* Context IN VOID* Context
); );
/** This function parses the debug device information structure. /**
This function parses the debug device information structure.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [out] Length Pointer in which the length of the debug @param [out] Length Pointer in which the length of the debug
device information is returned. device information is returned.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -95,12 +97,13 @@ STATIC CONST ACPI_PARSER DbgDevInfoParser[] = {
(VOID**)&AddrSizeOffset, NULL, NULL} (VOID**)&AddrSizeOffset, NULL, NULL}
}; };
/** This function validates the NameSpace string length. /**
This function validates the NameSpace string length.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -120,12 +123,13 @@ ValidateNameSpaceStrLen (
} }
} }
/** This function parses the debug device information structure. /**
This function parses the debug device information structure.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [out] Ptr Pointer in which the length of the debug @param [out] Length Pointer in which the length of the debug
device information is returned. device information is returned.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -193,7 +197,8 @@ DumpDbgDeviceInfo (
*Length = *DbgDevInfoLen; *Length = *DbgDevInfoLen;
} }
/** This function parses the ACPI DBG2 table. /**
This function parses the ACPI DBG2 table.
When trace is enabled this function parses the DBG2 table and When trace is enabled this function parses the DBG2 table and
traces the ACPI table fields. traces the ACPI table fields.
@ -203,7 +208,7 @@ DumpDbgDeviceInfo (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiDbg2 ( ParseAcpiDbg2 (

View File

@ -1,4 +1,4 @@
/** /** @file
DSDT table parser DSDT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -19,7 +19,8 @@
#include "AcpiParser.h" #include "AcpiParser.h"
#include "AcpiTableParser.h" #include "AcpiTableParser.h"
/** This function parses the ACPI DSDT table. /**
This function parses the ACPI DSDT table.
When trace is enabled this function parses the DSDT table and When trace is enabled this function parses the DSDT table and
traces the ACPI table fields. traces the ACPI table fields.
For the DSDT table only the ACPI header fields are parsed and For the DSDT table only the ACPI header fields are parsed and
@ -29,7 +30,7 @@
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiDsdt ( ParseAcpiDsdt (

View File

@ -1,4 +1,4 @@
/** /** @file
FADT table parser FADT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -25,43 +25,68 @@ STATIC CONST UINT64* X_DsdtAddress;
STATIC CONST UINT8* FadtMinorRevision; STATIC CONST UINT8* FadtMinorRevision;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** A macro defining the Hardware reduced ACPI flag /**
*/ A macro defining the Hardware reduced ACPI flag
**/
#define HW_REDUCED_ACPI BIT20 #define HW_REDUCED_ACPI BIT20
// Forward declarations /**
Get the ACPI XSDT header info.
**/
CONST ACPI_DESCRIPTION_HEADER_INFO* CONST CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
EFIAPI EFIAPI
GetAcpiXsdtHeaderInfo ( GetAcpiXsdtHeaderInfo (
VOID VOID
); );
/**
This function validates the Firmware Control Field.
@param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header.
**/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
ValidateFirmwareCtrl ( ValidateFirmwareCtrl (
IN UINT8* Ptr, IN UINT8* Ptr,
IN VOID* Context IN VOID* Context
); );
/**
This function validates the X_Firmware Control Field.
@param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header.
**/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
ValidateXFirmwareCtrl ( ValidateXFirmwareCtrl (
IN UINT8* Ptr, IN UINT8* Ptr,
IN VOID* Context IN VOID* Context
); );
/**
This function validates the flags.
@param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header.
**/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
ValidateFlags ( ValidateFlags (
IN UINT8* Ptr, IN UINT8* Ptr,
IN VOID* Context IN VOID* Context
); );
/** An ACPI_PARSER array describing the ACPI FADT Table. /**
*/ An ACPI_PARSER array describing the ACPI FADT Table.
**/
STATIC CONST ACPI_PARSER FadtParser[] = { STATIC CONST ACPI_PARSER FadtParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, NULL, ValidateFirmwareCtrl, NULL}, {L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, NULL, ValidateFirmwareCtrl, NULL},
@ -123,12 +148,13 @@ STATIC CONST ACPI_PARSER FadtParser[] = {
{L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL} {L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL}
}; };
/** This function validates the Firmware Control Field. /**
This function validates the Firmware Control Field.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -147,12 +173,13 @@ ValidateFirmwareCtrl (
#endif #endif
} }
/** This function validates the X_Firmware Control Field. /**
This function validates the X_Firmware Control Field.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -171,12 +198,13 @@ ValidateXFirmwareCtrl (
#endif #endif
} }
/** This function validates the flags. /**
This function validates the flags.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -195,9 +223,9 @@ ValidateFlags (
#endif #endif
} }
/** This function parses the ACPI FADT table. /**
This function parses the FADT table and optionally traces the ACPI This function parses the ACPI FADT table.
table fields. This function parses the FADT table and optionally traces the ACPI table fields.
This function also performs validation of the ACPI table fields. This function also performs validation of the ACPI table fields.
@ -205,7 +233,7 @@ ValidateFlags (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiFadt ( ParseAcpiFadt (

View File

@ -1,4 +1,4 @@
/** /** @file
GTDT table parser GTDT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -29,12 +29,13 @@ STATIC CONST UINT32* GtBlockTimerOffset;
STATIC CONST UINT16* GtBlockLength; STATIC CONST UINT16* GtBlockLength;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** This function validates the GT Block timer count. /**
This function validates the GT Block timer count.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -43,8 +44,9 @@ ValidateGtBlockTimerCount (
IN VOID* Context IN VOID* Context
); );
/** An ACPI_PARSER array describing the ACPI GTDT Table. /**
*/ An ACPI_PARSER array describing the ACPI GTDT Table.
**/
STATIC CONST ACPI_PARSER GtdtParser[] = { STATIC CONST ACPI_PARSER GtdtParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL, {L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL,
@ -69,16 +71,18 @@ STATIC CONST ACPI_PARSER GtdtParser[] = {
(VOID**)&GtdtPlatformTimerOffset, NULL, NULL} (VOID**)&GtdtPlatformTimerOffset, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the Platform timer header. /**
*/ An ACPI_PARSER array describing the Platform timer header.
**/
STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = { STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = {
{L"Type", 1, 0, NULL, NULL, (VOID**)&PlatformTimerType, NULL, NULL}, {L"Type", 1, 0, NULL, NULL, (VOID**)&PlatformTimerType, NULL, NULL},
{L"Length", 2, 1, NULL, NULL, (VOID**)&PlatformTimerLength, NULL, NULL}, {L"Length", 2, 1, NULL, NULL, (VOID**)&PlatformTimerLength, NULL, NULL},
{L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL} {L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the Platform GT Block. /**
*/ An ACPI_PARSER array describing the Platform GT Block.
**/
STATIC CONST ACPI_PARSER GtBlockParser[] = { STATIC CONST ACPI_PARSER GtBlockParser[] = {
{L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},
{L"Length", 2, 1, L"%d", NULL, (VOID**)&GtBlockLength, NULL, NULL}, {L"Length", 2, 1, L"%d", NULL, (VOID**)&GtBlockLength, NULL, NULL},
@ -90,8 +94,9 @@ STATIC CONST ACPI_PARSER GtBlockParser[] = {
NULL} NULL}
}; };
/** An ACPI_PARSER array describing the GT Block timer. /**
*/ An ACPI_PARSER array describing the GT Block timer.
**/
STATIC CONST ACPI_PARSER GtBlockTimerParser[] = { STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {
{L"Frame Number", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Frame Number", 1, 0, L"%d", NULL, NULL, NULL, NULL},
{L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}, {L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},
@ -105,8 +110,9 @@ STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {
{L"Common Flags", 4, 36, 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. /**
*/ An ACPI_PARSER array describing the Platform Watchdog.
**/
STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = { STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = {
{L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},
{L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},
@ -117,12 +123,13 @@ STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = {
{L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL} {L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** This function validates the GT Block timer count. /**
This function validates the GT Block timer count.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -141,11 +148,12 @@ ValidateGtBlockTimerCount (
} }
} }
/** This function parses the Platform GT Block. /**
This function parses the Platform GT Block.
@param [in] Ptr Pointer to the start of the GT Block data. @param [in] Ptr Pointer to the start of the GT Block data.
@param [in] Length Length of the GT Block structure. @param [in] Length Length of the GT Block structure.
*/ **/
STATIC STATIC
VOID VOID
DumpGTBlock ( DumpGTBlock (
@ -196,11 +204,12 @@ DumpGTBlock (
} }
} }
/** This function parses the Platform Watchdog timer. /**
This function parses the Platform Watchdog timer.
@param [in] Ptr Pointer to the start of the watchdog timer data. @param [in] Ptr Pointer to the start of the watchdog timer data.
@param [in] Length Length of the watchdog timer structure. @param [in] Length Length of the watchdog timer structure.
*/ **/
STATIC STATIC
VOID VOID
DumpWatchdogTimer ( DumpWatchdogTimer (
@ -218,7 +227,8 @@ DumpWatchdogTimer (
); );
} }
/** This function parses the ACPI GTDT table. /**
This function parses the ACPI GTDT table.
When trace is enabled this function parses the GTDT table and When trace is enabled this function parses the GTDT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -232,7 +242,7 @@ DumpWatchdogTimer (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiGtdt ( ParseAcpiGtdt (

View File

@ -1,4 +1,4 @@
/** /** @file
IORT table parser IORT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -23,8 +23,9 @@
// Local variables // Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** The EIORT_NODE enum describes the IORT Node types. /**
*/ The EIORT_NODE enum describes the IORT Node types.
**/
typedef enum IortNode { typedef enum IortNode {
EIORT_NODE_ITS_GROUP, ///< ITS Group node EIORT_NODE_ITS_GROUP, ///< ITS Group node
EIORT_NODE_NAMED_COMPONENT, ///< Named Component node EIORT_NODE_NAMED_COMPONENT, ///< Named Component node
@ -51,12 +52,13 @@ STATIC CONST UINT32* PmuInterruptOffset;
STATIC CONST UINT32* ItsCount; STATIC CONST UINT32* ItsCount;
/** This function validates the ID Mapping array count for the ITS node. /**
This function validates the ID Mapping array count for the ITS node.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -65,12 +67,13 @@ ValidateItsIdMappingCount (
IN VOID* Context IN VOID* Context
); );
/** This function validates the ID Mapping array offset for the ITS node. /**
This function validates the ID Mapping array offset for the ITS node.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -79,14 +82,14 @@ ValidateItsIdArrayReference (
IN VOID* Context IN VOID* Context
); );
/** Helper Macro for populating the IORT Node header in the ACPI_PARSER /**
array. Helper Macro for populating the IORT Node header in the ACPI_PARSER array.
@param [out] ValidateIdMappingCount Optional pointer to a function for @param [out] ValidateIdMappingCount Optional pointer to a function for
validating the ID Mapping count. validating the ID Mapping count.
@param [out] ValidateIdArrayReference Optional pointer to a function for @param [out] ValidateIdArrayReference Optional pointer to a function for
validating the ID Array reference. validating the ID Array reference.
*/ **/
#define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \ #define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \
ValidateIdArrayReference) \ ValidateIdArrayReference) \
{ L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \ { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \
@ -98,8 +101,9 @@ ValidateItsIdArrayReference (
{ L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \
(VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL } (VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL }
/** An ACPI_PARSER array describing the ACPI IORT Table /**
*/ An ACPI_PARSER array describing the ACPI IORT Table
**/
STATIC CONST ACPI_PARSER IortParser[] = { STATIC CONST ACPI_PARSER IortParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Number of IORT Nodes", 4, 36, L"%d", NULL, {L"Number of IORT Nodes", 4, 36, L"%d", NULL,
@ -109,14 +113,16 @@ STATIC CONST ACPI_PARSER IortParser[] = {
{L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL} {L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the IORT node header structure. /**
*/ 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) PARSE_IORT_NODE_HEADER (NULL, NULL)
}; };
/** An ACPI_PARSER array describing the IORT SMMUv1/2 node. /**
*/ An ACPI_PARSER array describing the IORT SMMUv1/2 node.
**/
STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = { STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
PARSE_IORT_NODE_HEADER (NULL, NULL), PARSE_IORT_NODE_HEADER (NULL, NULL),
{L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
@ -141,15 +147,17 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
{L"SMMU_NSgCfgIrpt interrupt flags", 4, 72, 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. /**
*/ An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array.
**/
STATIC CONST ACPI_PARSER InterruptArrayParser[] = { STATIC CONST ACPI_PARSER InterruptArrayParser[] = {
{L" Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L" Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L" Flags", 4, 4, 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. /**
*/ An ACPI_PARSER array describing the IORT ID Mapping.
**/
STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = { STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {
{L" Input base", 4, 0, L"0x%x", NULL, NULL, NULL, NULL}, {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" Number of IDs", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
@ -158,8 +166,9 @@ STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {
{L" Flags", 4, 16, 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. /**
*/ 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), PARSE_IORT_NODE_HEADER (NULL, NULL),
{L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
@ -173,8 +182,9 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] = {
{L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL} {L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the IORT ITS node. /**
*/ An ACPI_PARSER array describing the IORT ITS node.
**/
STATIC CONST ACPI_PARSER IortNodeItsParser[] = { STATIC CONST ACPI_PARSER IortNodeItsParser[] = {
PARSE_IORT_NODE_HEADER ( PARSE_IORT_NODE_HEADER (
ValidateItsIdMappingCount, ValidateItsIdMappingCount,
@ -183,14 +193,16 @@ STATIC CONST ACPI_PARSER IortNodeItsParser[] = {
{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. /**
*/ 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 } { L" GIC ITS Identifier", 4, 0, L"%d", NULL, NULL, NULL }
}; };
/** An ACPI_PARSER array describing the IORT Names Component node. /**
*/ 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), PARSE_IORT_NODE_HEADER (NULL, NULL),
{L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL}, {L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL},
@ -198,8 +210,9 @@ STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = {
{L"Device memory address size limit", 1, 28, L"%d", 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. /**
*/ 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), PARSE_IORT_NODE_HEADER (NULL, NULL),
{L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
@ -207,8 +220,9 @@ STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = {
{L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL} {L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the IORT PMCG node. /**
*/ An ACPI_PARSER array describing the IORT PMCG node.
**/
STATIC CONST ACPI_PARSER IortNodePmcgParser[] = { STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
PARSE_IORT_NODE_HEADER (NULL, NULL), PARSE_IORT_NODE_HEADER (NULL, NULL),
{L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},
@ -216,18 +230,19 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
{L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},
}; };
/** This function validates the ID Mapping array count for the ITS node. /**
This function validates the ID Mapping array count for the ITS node.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
ValidateItsIdMappingCount ( ValidateItsIdMappingCount (
IN UINT8* Ptr, IN UINT8* Ptr,
VOID* Context IN VOID* Context
) )
{ {
if (*(UINT32*)Ptr != 0) { if (*(UINT32*)Ptr != 0) {
@ -236,12 +251,13 @@ ValidateItsIdMappingCount (
} }
} }
/** This function validates the ID Mapping array offset for the ITS node. /**
This function validates the ID Mapping array offset for the ITS node.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -256,13 +272,14 @@ ValidateItsIdArrayReference (
} }
} }
/** This function parses the IORT Node Id Mapping array. /**
This function parses the IORT Node Id Mapping array.
@param [in] Ptr Pointer to the start of the IORT Table. @param [in] Ptr Pointer to the start of the IORT Table.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeIdMappings ( DumpIortNodeIdMappings (
@ -298,14 +315,15 @@ DumpIortNodeIdMappings (
} }
} }
/** This function parses the IORT SMMUv1/2 node. /**
This function parses the IORT SMMUv1/2 node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeSmmuV1V2 ( DumpIortNodeSmmuV1V2 (
@ -377,14 +395,15 @@ DumpIortNodeSmmuV1V2 (
} }
} }
/** This function parses the IORT SMMUv3 node. /**
This function parses the IORT SMMUv3 node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeSmmuV3 ( DumpIortNodeSmmuV3 (
@ -408,11 +427,12 @@ DumpIortNodeSmmuV3 (
} }
} }
/** This function parses the IORT ITS node. /**
This function parses the IORT ITS node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeIts ( DumpIortNodeIts (
@ -458,14 +478,15 @@ DumpIortNodeIts (
// Note: ITS does not have the ID Mappings Array // Note: ITS does not have the ID Mappings Array
} }
/** This function parses the IORT Named Component node. /**
This function parses the IORT Named Component node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeNamedComponent ( DumpIortNodeNamedComponent (
@ -504,14 +525,15 @@ DumpIortNodeNamedComponent (
} }
} }
/** This function parses the IORT Root Complex node. /**
This function parses the IORT Root Complex node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodeRootComplex ( DumpIortNodeRootComplex (
@ -535,14 +557,15 @@ DumpIortNodeRootComplex (
} }
} }
/** This function parses the IORT PMCG node. /**
This function parses the IORT PMCG node.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] Length Length of the buffer. @param [in] Length Length of the buffer.
@param [in] MappingCount The ID Mapping count. @param [in] MappingCount The ID Mapping count.
@param [in] MappingOffset The offset of the ID Mapping array @param [in] MappingOffset The offset of the ID Mapping array
from the start of the IORT table. from the start of the IORT table.
*/ **/
STATIC STATIC
VOID VOID
DumpIortNodePmcg ( DumpIortNodePmcg (
@ -574,9 +597,9 @@ DumpIortNodePmcg (
} }
} }
/** This function parses the ACPI IORT table. /**
When trace is enabled this function parses the IORT table and This function parses the ACPI IORT table.
traces the ACPI fields. When trace is enabled this function parses the IORT table and traces the ACPI fields.
This function also parses the following nodes: This function also parses the following nodes:
- ITS Group - ITS Group
@ -592,7 +615,7 @@ DumpIortNodePmcg (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiIort ( ParseAcpiIort (

View File

@ -1,4 +1,4 @@
/** /** @file
MADT table parser MADT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -24,18 +24,24 @@ STATIC CONST UINT8* MadtInterruptControllerType;
STATIC CONST UINT8* MadtInterruptControllerLength; STATIC CONST UINT8* MadtInterruptControllerLength;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
// Forward declarations /**
This function validates the System Vector Base in the GICD.
@param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header.
**/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
ValidateGICDSystemVectorBase ( ValidateGICDSystemVectorBase (
IN UINT8* Ptr, IN UINT8* Ptr,
IN VOID* Context IN VOID* Context
); );
/** An ACPI_PARSER array describing the GICC Interrupt /**
Controller Structure. An ACPI_PARSER array describing the GICC Interrupt Controller Structure.
*/ **/
STATIC CONST ACPI_PARSER GicCParser[] = { STATIC CONST ACPI_PARSER GicCParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
@ -59,9 +65,9 @@ STATIC CONST ACPI_PARSER GicCParser[] = {
{L"Reserved", 3, 77, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} {L"Reserved", 3, 77, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the GICD Interrupt /**
Controller Structure. An ACPI_PARSER array describing the GICD Interrupt Controller Structure.
*/ **/
STATIC CONST ACPI_PARSER GicDParser[] = { STATIC CONST ACPI_PARSER GicDParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
@ -75,9 +81,9 @@ STATIC CONST ACPI_PARSER GicDParser[] = {
{L"Reserved", 3, 21, L"%x %x %x", Dump3Chars, 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. An ACPI_PARSER array describing the MSI Frame Interrupt Controller Structure.
*/ **/
STATIC CONST ACPI_PARSER GicMSIFrameParser[] = { STATIC CONST ACPI_PARSER GicMSIFrameParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
@ -91,9 +97,9 @@ STATIC CONST ACPI_PARSER GicMSIFrameParser[] = {
{L"SPI Base", 2, 22, L"0x%x", 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. An ACPI_PARSER array describing the GICR Interrupt Controller Structure.
*/ **/
STATIC CONST ACPI_PARSER GicRParser[] = { STATIC CONST ACPI_PARSER GicRParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
@ -104,9 +110,9 @@ STATIC CONST ACPI_PARSER GicRParser[] = {
{L"Discovery Range Length", 4, 12, L"0x%x", 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. An ACPI_PARSER array describing the GIC ITS Interrupt Controller Structure.
*/ **/
STATIC CONST ACPI_PARSER GicITSParser[] = { STATIC CONST ACPI_PARSER GicITSParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
@ -117,8 +123,9 @@ STATIC CONST ACPI_PARSER GicITSParser[] = {
{L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} {L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the ACPI MADT Table. /**
*/ An ACPI_PARSER array describing the ACPI MADT Table.
**/
STATIC CONST ACPI_PARSER MadtParser[] = { STATIC CONST ACPI_PARSER MadtParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Local Interrupt Controller Address", 4, 36, L"0x%x", NULL, NULL, NULL, {L"Local Interrupt Controller Address", 4, 36, L"0x%x", NULL, NULL, NULL,
@ -126,9 +133,9 @@ STATIC CONST ACPI_PARSER MadtParser[] = {
{L"Flags", 4, 40, 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. An ACPI_PARSER array describing the MADT Interrupt Controller Structure Header Structure.
*/ **/
STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = { STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
{NULL, 1, 0, NULL, NULL, (VOID**)&MadtInterruptControllerType, NULL, NULL}, {NULL, 1, 0, NULL, NULL, (VOID**)&MadtInterruptControllerType, NULL, NULL},
{L"Length", 1, 1, NULL, NULL, (VOID**)&MadtInterruptControllerLength, NULL, {L"Length", 1, 1, NULL, NULL, (VOID**)&MadtInterruptControllerLength, NULL,
@ -136,12 +143,13 @@ STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
{L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL} {L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL}
}; };
/** This function validates the System Vector Base in the GICD. /**
This function validates the System Vector Base in the GICD.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -158,7 +166,8 @@ ValidateGICDSystemVectorBase (
} }
} }
/** This function parses the ACPI MADT table. /**
This function parses the ACPI MADT table.
When trace is enabled this function parses the MADT table and When trace is enabled this function parses the MADT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -176,7 +185,7 @@ ValidateGICDSystemVectorBase (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiMadt ( ParseAcpiMadt (

View File

@ -1,4 +1,4 @@
/** /** @file
MCFG table parser MCFG table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -22,16 +22,17 @@
// Local variables // Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** An ACPI_PARSER array describing the ACPI MCFG Table. /**
*/ An ACPI_PARSER array describing the ACPI MCFG Table.
**/
STATIC CONST ACPI_PARSER McfgParser[] = { STATIC CONST ACPI_PARSER McfgParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), 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. An ACPI_PARSER array describing the PCI configuration Space Base Address structure.
*/ **/
STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = { STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
{L"Base Address", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL}, {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"PCI Segment Group No.", 2, 8, L"0x%x", NULL, NULL, NULL, NULL},
@ -40,7 +41,8 @@ STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
{L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL} {L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}
}; };
/** This function parses the ACPI MCFG table. /**
This function parses the ACPI MCFG table.
When trace is enabled this function parses the MCFG table and When trace is enabled this function parses the MCFG table and
traces the ACPI table fields. traces the ACPI table fields.
@ -50,7 +52,7 @@ STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] = {
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiMcfg ( ParseAcpiMcfg (

View File

@ -1,4 +1,4 @@
/** /** @file
RSDP table parser RSDP table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -21,12 +21,13 @@
// Local Variables // Local Variables
STATIC CONST UINT64* XsdtAddress; STATIC CONST UINT64* XsdtAddress;
/** This function validates the RSDT Address. /**
This function validates the RSDT Address.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -35,12 +36,13 @@ ValidateRsdtAddress (
IN VOID* Context IN VOID* Context
); );
/** This function validates the XSDT Address. /**
This function validates the XSDT Address.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -49,8 +51,9 @@ ValidateXsdtAddress (
IN VOID* Context IN VOID* Context
); );
/** An array describing the ACPI RSDP Table. /**
*/ An array describing the ACPI RSDP Table.
**/
STATIC CONST ACPI_PARSER RsdpParser[] = { STATIC CONST ACPI_PARSER RsdpParser[] = {
{L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL}, {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL},
{L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL}, {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
@ -64,12 +67,13 @@ STATIC CONST ACPI_PARSER RsdpParser[] = {
{L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
}; };
/** This function validates the RSDT Address. /**
This function validates the RSDT Address.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -95,12 +99,13 @@ ValidateRsdtAddress (
#endif #endif
} }
/** This function validates the XSDT Address. /**
This function validates the XSDT Address.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -126,7 +131,8 @@ ValidateXsdtAddress (
#endif #endif
} }
/** This function parses the ACPI RSDP table. /**
This function parses the ACPI RSDP table.
This function invokes the parser for the XSDT table. This function invokes the parser for the XSDT table.
* Note - This function does not support parsing of RSDT table. * Note - This function does not support parsing of RSDT table.
@ -138,7 +144,7 @@ ValidateXsdtAddress (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiRsdp ( ParseAcpiRsdp (

View File

@ -1,4 +1,4 @@
/** /** @file
SLIT table parser SLIT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -24,19 +24,22 @@
STATIC CONST UINT64* SlitSystemLocalityCount; STATIC CONST UINT64* SlitSystemLocalityCount;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** An ACPI_PARSER array describing the ACPI SLIT table. /**
*/ An ACPI_PARSER array describing the ACPI SLIT table.
**/
STATIC CONST ACPI_PARSER SlitParser[] = { STATIC CONST ACPI_PARSER SlitParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Number of System Localities", 8, 36, L"0x%lx", NULL, {L"Number of System Localities", 8, 36, L"0x%lx", NULL,
(VOID**)&SlitSystemLocalityCount, NULL, NULL} (VOID**)&SlitSystemLocalityCount, NULL, NULL}
}; };
/** Macro to get the value of a System Locality /**
*/ 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. /**
This function parses the ACPI SLIT table.
When trace is enabled this function parses the SLIT table and When trace is enabled this function parses the SLIT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -49,7 +52,7 @@ STATIC CONST ACPI_PARSER SlitParser[] = {
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSlit ( ParseAcpiSlit (

View File

@ -1,4 +1,4 @@
/** /** @file
SPCR table parser SPCR table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -24,12 +24,13 @@
// Local variables // Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** This function validates the Interrupt Type. /**
This function validates the Interrupt Type.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -38,12 +39,13 @@ ValidateInterruptType (
IN VOID* Context IN VOID* Context
); );
/** This function validates the Irq. /**
This function validates the Irq.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -52,8 +54,9 @@ ValidateIrq (
IN VOID* Context IN VOID* Context
); );
/** An ACPI_PARSER array describing the ACPI SPCR Table. /**
*/ An ACPI_PARSER array describing the ACPI SPCR Table.
**/
STATIC CONST ACPI_PARSER SpcrParser[] = { STATIC CONST ACPI_PARSER SpcrParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL}, {L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL},
@ -79,12 +82,13 @@ STATIC CONST ACPI_PARSER SpcrParser[] = {
{L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL} {L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL}
}; };
/** This function validates the Interrupt Type. /**
This function validates the Interrupt Type.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -106,12 +110,13 @@ ValidateInterruptType (
#endif #endif
} }
/** This function validates the Irq. /**
This function validates the Irq.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -132,7 +137,8 @@ ValidateIrq (
#endif #endif
} }
/** This function parses the ACPI SPCR table. /**
This function parses the ACPI SPCR table.
When trace is enabled this function parses the SPCR table and When trace is enabled this function parses the SPCR table and
traces the ACPI table fields. traces the ACPI table fields.
@ -142,7 +148,7 @@ ValidateIrq (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSpcr ( ParseAcpiSpcr (

View File

@ -1,4 +1,4 @@
/** /** @file
SRAT table parser SRAT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -25,12 +25,13 @@ STATIC CONST UINT8* SratRAType;
STATIC CONST UINT8* SratRALength; STATIC CONST UINT8* SratRALength;
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
/** This function validates the Reserved field in the SRAT table header. /**
This function validates the Reserved field in the SRAT table header.
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -39,11 +40,12 @@ ValidateSratReserved (
IN VOID* Context IN VOID* Context
); );
/** This function traces the APIC Proximity Domain field. /**
This function traces the APIC Proximity Domain field.
@param [in] Format Format string for tracing the data. @param [in] Format Format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
STATIC STATIC
VOID VOID
DumpSratApicProximity ( DumpSratApicProximity (
@ -51,24 +53,26 @@ DumpSratApicProximity (
IN UINT8* Ptr IN UINT8* Ptr
); );
/** An ACPI_PARSER array describing the SRAT Table. /**
*/ An ACPI_PARSER array describing the SRAT Table.
**/
STATIC CONST ACPI_PARSER SratParser[] = { STATIC CONST ACPI_PARSER SratParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo), PARSE_ACPI_HEADER (&AcpiHdrInfo),
{L"Reserved", 4, 36, L"0x%x", NULL, NULL, ValidateSratReserved, NULL}, {L"Reserved", 4, 36, L"0x%x", NULL, NULL, ValidateSratReserved, NULL},
{L"Reserved", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL} {L"Reserved", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the Resource Allocation /**
structure header. An ACPI_PARSER array describing the Resource Allocation structure header.
*/ **/
STATIC CONST ACPI_PARSER SratResourceAllocationParser[] = { STATIC CONST ACPI_PARSER SratResourceAllocationParser[] = {
{L"Type", 1, 0, NULL, NULL, (VOID**)&SratRAType, NULL, NULL}, {L"Type", 1, 0, NULL, NULL, (VOID**)&SratRAType, NULL, NULL},
{L"Length", 1, 1, NULL, NULL, (VOID**)&SratRALength, NULL, NULL} {L"Length", 1, 1, NULL, NULL, (VOID**)&SratRALength, NULL, NULL}
}; };
/** An ACPI_PARSER array describing the GICC Affinity structure. /**
*/ An ACPI_PARSER array describing the GICC Affinity structure.
**/
STATIC CONST ACPI_PARSER SratGicCAffinityParser[] = { STATIC CONST ACPI_PARSER SratGicCAffinityParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -79,8 +83,9 @@ STATIC CONST ACPI_PARSER SratGicCAffinityParser[] = {
{L"Clock Domain", 4, 14, 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. /**
*/ An ACPI_PARSER array describing the GIC ITS Affinity structure.
**/
STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] = { STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -90,8 +95,9 @@ STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] = {
{L"ITS Id", 4, 8, 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 Memory Affinity structure. /**
*/ An ACPI_PARSER array describing the Memory Affinity structure.
**/
STATIC CONST ACPI_PARSER SratMemAffinityParser[] = { STATIC CONST ACPI_PARSER SratMemAffinityParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -107,8 +113,9 @@ STATIC CONST ACPI_PARSER SratMemAffinityParser[] = {
{L"Reserved", 8, 32, L"0x%lx", 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. /**
*/ An ACPI_PARSER array describing the APIC/SAPIC Affinity structure.
**/
STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] = { STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -122,9 +129,9 @@ STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] = {
{L"Clock Domain", 4, 12, L"0x%x", NULL, 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. An ACPI_PARSER array describing the Processor Local x2APIC Affinity structure.
*/ **/
STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = { STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
{L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
{L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL},
@ -142,7 +149,7 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
@param [in] Ptr Pointer to the start of the field data. @param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this @param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header. could be a pointer to the ACPI table header.
*/ **/
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
@ -157,11 +164,12 @@ ValidateSratReserved (
} }
} }
/** This function traces the APIC Proximity Domain field. /**
This function traces the APIC Proximity Domain field.
@param [in] Format Format string for tracing the data. @param [in] Format Format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
*/ **/
STATIC STATIC
VOID VOID
DumpSratApicProximity ( DumpSratApicProximity (
@ -173,7 +181,8 @@ DumpSratApicProximity (
Print (Format, ProximityDomain); Print (Format, ProximityDomain);
} }
/** This function parses the ACPI SRAT table. /**
This function parses the ACPI SRAT table.
When trace is enabled this function parses the SRAT table and When trace is enabled this function parses the SRAT table and
traces the ACPI table fields. traces the ACPI table fields.
@ -189,7 +198,7 @@ DumpSratApicProximity (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSrat ( ParseAcpiSrat (

View File

@ -1,4 +1,4 @@
/** /** @file
SSDT table parser SSDT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -19,7 +19,8 @@
#include "AcpiParser.h" #include "AcpiParser.h"
#include "AcpiTableParser.h" #include "AcpiTableParser.h"
/** This function parses the ACPI SSDT table. /**
This function parses the ACPI SSDT table.
When trace is enabled this function parses the SSDT table and When trace is enabled this function parses the SSDT table and
traces the ACPI table fields. traces the ACPI table fields.
For the SSDT table only the ACPI header fields are For the SSDT table only the ACPI header fields are
@ -29,7 +30,7 @@
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiSsdt ( ParseAcpiSsdt (

View File

@ -1,4 +1,4 @@
/** /** @file
XSDT table parser XSDT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
@ -29,6 +29,9 @@ STATIC CONST ACPI_PARSER XsdtParser[] = {
PARSE_ACPI_HEADER (&AcpiHdrInfo) PARSE_ACPI_HEADER (&AcpiHdrInfo)
}; };
/**
Get the ACPI XSDT header info.
**/
CONST ACPI_DESCRIPTION_HEADER_INFO* CONST CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
EFIAPI EFIAPI
GetAcpiXsdtHeaderInfo ( GetAcpiXsdtHeaderInfo (
@ -38,8 +41,8 @@ GetAcpiXsdtHeaderInfo (
return &AcpiHdrInfo; return &AcpiHdrInfo;
} }
/** This function parses the ACPI XSDT table /**
and optionally traces the ACPI table fields. This function parses the ACPI XSDT table and optionally traces the ACPI table fields.
This function also performs validation of the XSDT table. This function also performs validation of the XSDT table.
@ -47,7 +50,7 @@ GetAcpiXsdtHeaderInfo (
@param [in] Ptr Pointer to the start of the buffer. @param [in] Ptr Pointer to the start of the buffer.
@param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableLength Length of the ACPI table.
@param [in] AcpiTableRevision Revision of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table.
*/ **/
VOID VOID
EFIAPI EFIAPI
ParseAcpiXsdt ( ParseAcpiXsdt (

View File

@ -1,4 +1,4 @@
/** /** @file
Main file for 'acpiview' Shell command function. Main file for 'acpiview' Shell command function.
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR> Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
@ -49,7 +49,8 @@ ACPI_TABLE_PARSER ParserList[] = {
{EFI_ACPI_6_2_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiXsdt} {EFI_ACPI_6_2_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiXsdt}
}; };
/** This function registers all the available table parsers. /**
This function registers all the available table parsers.
@retval EFI_SUCCESS The parser is registered. @retval EFI_SUCCESS The parser is registered.
@retval EFI_ALREADY_STARTED The parser for the ACPI Table @retval EFI_ALREADY_STARTED The parser for the ACPI Table
@ -57,7 +58,7 @@ ACPI_TABLE_PARSER ParserList[] = {
@retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_OUT_OF_RESOURCES No space to register the @retval EFI_OUT_OF_RESOURCES No space to register the
parser. parser.
*/ **/
EFI_STATUS EFI_STATUS
RegisterAllParsers ( RegisterAllParsers (
) )
@ -80,7 +81,7 @@ RegisterAllParsers (
Return the file name of the help text file if not using HII. Return the file name of the help text file if not using HII.
@return The string pointer to the file name. @return The string pointer to the file name.
*/ **/
CONST CHAR16* CONST CHAR16*
EFIAPI EFIAPI
ShellCommandGetManFileNameAcpiView ( ShellCommandGetManFileNameAcpiView (
@ -101,7 +102,7 @@ ShellCommandGetManFileNameAcpiView (
@retval EFI_SUCCESS The Shell command handlers were installed @retval EFI_SUCCESS The Shell command handlers were installed
successfully. successfully.
@retval EFI_DEVICE_ERROR Hii package failed to install. @retval EFI_DEVICE_ERROR Hii package failed to install.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UefiShellAcpiViewCommandLibConstructor ( UefiShellAcpiViewCommandLibConstructor (
@ -152,7 +153,7 @@ UefiShellAcpiViewCommandLibConstructor (
@param ImageHandle The image handle of the process. @param ImageHandle The image handle of the process.
@param SystemTable The EFI System Table pointer. @param SystemTable The EFI System Table pointer.
*/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UefiShellAcpiViewCommandLibDestructor ( UefiShellAcpiViewCommandLibDestructor (

View File

@ -1,4 +1,4 @@
/** /** @file
Header file for 'acpiview' Shell command functions. Header file for 'acpiview' Shell command functions.
Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.<BR> Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.<BR>
@ -21,7 +21,7 @@ extern EFI_HII_HANDLE gShellAcpiViewHiiHandle;
@param[in] ImageHandle Handle to the Image (NULL if Internal). @param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal). @param[in] SystemTable Pointer to the System Table (NULL if Internal).
*/ **/
SHELL_STATUS SHELL_STATUS
EFIAPI EFIAPI
ShellCommandRunAcpiView ( ShellCommandRunAcpiView (