summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <carsten.haitzler@foss.arm.com>2024-10-01 10:04:48 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-04 20:48:11 +0300
commitdf884297fd57aac379d227925e27211e667974ee (patch)
treef080a4ca6e9f207c69d3d3aa4b92052dc95ed03c
parentc82bf392c58e60e3e656b13627e3076d709ab796 (diff)
downloadedk2-df884297fd57aac379d227925e27211e667974ee.tar.xz
ShellPkg/AcpiView: RASF Parser
Add a new parser for the RASF Table as specified in ACPI6.5 Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h23
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rasf/RasfParser.c61
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf1
4 files changed, 86 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 32816242fc..ded5657f00 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -1030,6 +1030,29 @@ ParseAcpiRas2 (
);
/**
+ This function parses the ACPI RASF table.
+ When trace is enabled this function parses the RASF table and
+ traces the ACPI table fields.
+
+ This function parses the RASF ACPI table
+
+ This function also performs validation of the ACPI table fields.
+
+ @param [in] Trace If TRUE, trace the ACPI fields.
+ @param [in] Ptr Pointer to the start of the buffer.
+ @param [in] AcpiTableLength Length of the ACPI table.
+ @param [in] AcpiTableRevision Revision of the ACPI table.
+**/
+VOID
+EFIAPI
+ParseAcpiRasf (
+ IN BOOLEAN Trace,
+ IN UINT8 *Ptr,
+ IN UINT32 AcpiTableLength,
+ IN UINT8 AcpiTableRevision
+ );
+
+/**
This function parses the ACPI RSDP table.
This function invokes the parser for the XSDT table.
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rasf/RasfParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rasf/RasfParser.c
new file mode 100644
index 0000000000..d78531cbe1
--- /dev/null
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rasf/RasfParser.c
@@ -0,0 +1,61 @@
+/** @file
+ RASF table parser
+
+ Copyright (c) 2024, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Reference(s):
+ - ACPI 6.5 Specification - August 2022
+**/
+
+#include <Library/PrintLib.h>
+#include <Library/BaseLib.h>
+#include <Library/UefiLib.h>
+#include "AcpiParser.h"
+#include "AcpiView.h"
+
+STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
+
+/**
+ An ACPI_PARSER array describing the ACPI RASF Table.
+**/
+STATIC CONST ACPI_PARSER RasfParser[] = {
+ PARSE_ACPI_HEADER (&AcpiHdrInfo),
+ { L"RASF PCC Identifier", 12,36, L"%02X %02X %02X %02X - %02X %02X %02X %02X - %02X %02X %02X %02X", Dump12Chars, NULL, NULL, NULL }
+};
+
+/**
+ This function parses the ACPI RASF table.
+ When trace is enabled this function parses the RASF table and
+ traces the ACPI table fields.
+
+ This function also performs validation of the ACPI table fields.
+
+ @param [in] Trace If TRUE, trace the ACPI fields.
+ @param [in] Ptr Pointer to the start of the buffer.
+ @param [in] AcpiTableLength Length of the ACPI table.
+ @param [in] AcpiTableRevision Revision of the ACPI table.
+**/
+VOID
+EFIAPI
+ParseAcpiRasf (
+ IN BOOLEAN Trace,
+ IN UINT8 *Ptr,
+ IN UINT32 AcpiTableLength,
+ IN UINT8 AcpiTableRevision
+ )
+{
+ if (!Trace) {
+ return;
+ }
+
+ // Parse ACPI Header + RASF "fixed" fields
+ ParseAcpi (
+ Trace,
+ 0,
+ "RASF",
+ Ptr,
+ AcpiTableLength,
+ PARSER_PARAMS (RasfParser)
+ );
+}
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
index 5e73a39095..7b140a062b 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
@@ -72,6 +72,7 @@ ACPI_TABLE_PARSER ParserList[] = {
{ EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
ParseAcpiPptt },
{ EFI_ACPI_6_5_ACPI_RAS2_FEATURE_TABLE_SIGNATURE, ParseAcpiRas2 },
+ { EFI_ACPI_6_5_ACPI_RAS_FEATURE_TABLE_SIGNATURE, ParseAcpiRasf },
{ RSDP_TABLE_INFO, ParseAcpiRsdp },
{ EFI_ACPI_6_2_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE, ParseAcpiSlit },
{ EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, ParseAcpiSpcr },
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
index 7ef8b0afb7..af77856a85 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
@@ -51,6 +51,7 @@
Parsers/Pptt/PpttParser.c
Parsers/Pptt/PpttParser.h
Parsers/Ras2/Ras2Parser.c
+ Parsers/Rasf/RasfParser.c
Parsers/Rsdp/RsdpParser.c
Parsers/Slit/SlitParser.c
Parsers/Spcr/SpcrParser.c