summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorTomas Pilar <Tomas.Pilar@arm.com>2020-06-19 12:59:54 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-06-30 01:39:50 +0000
commite18ac66d84e68387dbbe4fd8761b8f3a889534a9 (patch)
tree553c68ef79a9502caf0c73922192320ff7f7e765 /ShellPkg/Library
parentcae974bea25a3193360390af0b405488a19e1e15 (diff)
downloadedk2-e18ac66d84e68387dbbe4fd8761b8f3a889534a9.tar.gz
edk2-e18ac66d84e68387dbbe4fd8761b8f3a889534a9.tar.bz2
edk2-e18ac66d84e68387dbbe4fd8761b8f3a889534a9.zip
ShellPkg/AcpiView: Refactor configuration
A new file and header (AcpiViewConfig.[ch]) is created that houses the user configuration. This declutters the core code and improves modularity of the design. The module level symbols for verbosity, table selection, and highlighting are refactored into the new file. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c237
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h95
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c246
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h177
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c1
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf32
12 files changed, 479 insertions, 315 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 3f12a33050..02f6d771c7 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -10,6 +10,7 @@
#include <Library/UefiBootServicesTableLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"
+#include "AcpiViewConfig.h"
STATIC UINT32 gIndent;
STATIC UINT32 mTableErrorCount;
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c
index d5b9eee523..4b618f131e 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c
@@ -17,6 +17,7 @@
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiView.h"
+#include "AcpiViewConfig.h"
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
#include "Arm/SbbrValidator.h"
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
index f1a95b7b8f..b068dd4d27 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
@@ -20,6 +20,7 @@
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiView.h"
+#include "AcpiViewConfig.h"
#include "UefiShellAcpiViewCommandLib.h"
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
@@ -28,17 +29,8 @@
EFI_HII_HANDLE gShellAcpiViewHiiHandle = NULL;
-// Report variables
-STATIC UINT32 mSelectedAcpiTable;
-STATIC CONST CHAR16* mSelectedAcpiTableName;
-STATIC BOOLEAN mSelectedAcpiTableFound;
-STATIC EREPORT_OPTION mReportType;
STATIC UINT32 mTableCount;
STATIC UINT32 mBinTableCount;
-STATIC BOOLEAN mConsistencyCheck;
-STATIC BOOLEAN mColourHighlighting;
-STATIC BOOLEAN mMandatoryTableValidate;
-STATIC UINTN mMandatoryTableSpec;
/**
An array of acpiview command line parameters.
@@ -54,142 +46,6 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
};
/**
- This function returns the colour highlighting status.
-
- @retval TRUE if colour highlighting is enabled.
-**/
-BOOLEAN
-GetColourHighlighting (
- VOID
- )
-{
- return mColourHighlighting;
-}
-
-/**
- This function sets the colour highlighting status.
-
- @param Highlight The Highlight status.
-
-**/
-VOID
-SetColourHighlighting (
- BOOLEAN Highlight
- )
-{
- mColourHighlighting = Highlight;
-}
-
-/**
- This function returns the consistency checking status.
-
- @retval TRUE if consistency checking is enabled.
-**/
-BOOLEAN
-GetConsistencyChecking (
- VOID
- )
-{
- return mConsistencyCheck;
-}
-
-/**
- This function sets the consistency checking status.
-
- @param ConsistencyChecking The consistency checking status.
-
-**/
-VOID
-SetConsistencyChecking (
- BOOLEAN ConsistencyChecking
- )
-{
- mConsistencyCheck = ConsistencyChecking;
-}
-
-/**
- This function returns the ACPI table requirements validation flag.
-
- @retval TRUE if check for mandatory table presence should be performed.
-**/
-BOOLEAN
-GetMandatoryTableValidate (
- VOID
- )
-{
- return mMandatoryTableValidate;
-}
-
-/**
- This function sets the ACPI table requirements validation flag.
-
- @param Validate Enable/Disable ACPI table requirements validation.
-**/
-VOID
-SetMandatoryTableValidate (
- BOOLEAN Validate
- )
-{
- mMandatoryTableValidate = Validate;
-}
-
-/**
- This function returns the identifier of specification to validate ACPI table
- requirements against.
-
- @return ID of specification listing mandatory tables.
-**/
-UINTN
-GetMandatoryTableSpec (
- VOID
- )
-{
- return mMandatoryTableSpec;
-}
-
-/**
- This function sets the identifier of specification to validate ACPI table
- requirements against.
-
- @param Spec ID of specification listing mandatory tables.
-**/
-VOID
-SetMandatoryTableSpec (
- UINTN Spec
- )
-{
- mMandatoryTableSpec = Spec;
-}
-
-/**
- This function returns the report options.
-
- @retval Returns the report option.
-**/
-STATIC
-EREPORT_OPTION
-GetReportOption (
- VOID
- )
-{
- return mReportType;
-}
-
-/**
- This function returns the selected ACPI table.
-
- @retval Returns signature of the selected ACPI table.
-**/
-STATIC
-UINT32
-GetSelectedAcpiTable (
- VOID
- )
-{
- return mSelectedAcpiTable;
-}
-
-/**
This function dumps the ACPI table to a file.
@param [in] Ptr Pointer to the ACPI table data.
@@ -205,19 +61,21 @@ DumpAcpiTableToFile (
IN CONST UINTN Length
)
{
- EFI_STATUS Status;
- CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN];
- SHELL_FILE_HANDLE DumpFileHandle;
- UINTN TransferBytes;
+ EFI_STATUS Status;
+ CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN];
+ SHELL_FILE_HANDLE DumpFileHandle;
+ UINTN TransferBytes;
+ SELECTED_ACPI_TABLE *SelectedTable;
DumpFileHandle = NULL;
TransferBytes = Length;
+ GetSelectedAcpiTable (&SelectedTable);
UnicodeSPrint (
FileNameBuffer,
sizeof (FileNameBuffer),
L".\\%s%04d.bin",
- mSelectedAcpiTableName,
+ SelectedTable->Name,
mBinTableCount++
);
@@ -273,10 +131,11 @@ ProcessTableReportOptions (
IN CONST UINT32 Length
)
{
- UINTN OriginalAttribute;
- UINT8* SignaturePtr;
- BOOLEAN Log;
- BOOLEAN HighLight;
+ UINTN OriginalAttribute;
+ UINT8 *SignaturePtr;
+ BOOLEAN Log;
+ BOOLEAN HighLight;
+ SELECTED_ACPI_TABLE *SelectedTable;
//
// set local variables to suppress incorrect compiler/analyzer warnings
@@ -285,15 +144,16 @@ ProcessTableReportOptions (
SignaturePtr = (UINT8*)(UINTN)&Signature;
Log = FALSE;
HighLight = GetColourHighlighting ();
+ GetSelectedAcpiTable (&SelectedTable);
switch (GetReportOption ()) {
case ReportAll:
Log = TRUE;
break;
case ReportSelected:
- if (Signature == GetSelectedAcpiTable ()) {
+ if (Signature == SelectedTable->Type) {
Log = TRUE;
- mSelectedAcpiTableFound = TRUE;
+ SelectedTable->Found = TRUE;
}
break;
case ReportTableList:
@@ -321,8 +181,8 @@ ProcessTableReportOptions (
);
break;
case ReportDumpBinFile:
- if (Signature == GetSelectedAcpiTable ()) {
- mSelectedAcpiTableFound = TRUE;
+ if (Signature == SelectedTable->Type) {
+ SelectedTable->Found = TRUE;
DumpAcpiTableToFile (TablePtr, Length);
}
break;
@@ -356,37 +216,7 @@ ProcessTableReportOptions (
return Log;
}
-/**
- This function converts a string to ACPI table signature.
-
- @param [in] Str Pointer to the string to be converted to the
- ACPI table signature.
- @retval The ACPI table signature.
-**/
-STATIC
-UINT32
-ConvertStrToAcpiSignature (
- IN CONST CHAR16* Str
- )
-{
- UINT8 Index;
- CHAR8 Ptr[4];
-
- ZeroMem (Ptr, sizeof (Ptr));
- Index = 0;
-
- // Convert to Upper case and convert to ASCII
- while ((Index < 4) && (Str[Index] != 0)) {
- if (Str[Index] >= L'a' && Str[Index] <= L'z') {
- Ptr[Index] = (CHAR8)(Str[Index] - (L'a' - L'A'));
- } else {
- Ptr[Index] = (CHAR8)Str[Index];
- }
- Index++;
- }
- return *(UINT32*)Ptr;
-}
/**
This function iterates the configuration table entries in the
@@ -417,6 +247,7 @@ AcpiView (
UINT8 RsdpRevision;
PARSE_ACPI_TABLE_PROC RsdpParserProc;
BOOLEAN Trace;
+ SELECTED_ACPI_TABLE *SelectedTable;
//
// set local variables to suppress incorrect compiler/analyzer warnings
@@ -428,6 +259,9 @@ AcpiView (
ResetErrorCount ();
ResetWarningCount ();
+ // Retrieve the user selection of ACPI table to process
+ GetSelectedAcpiTable (&SelectedTable);
+
// Search the table for an entry that matches the ACPI Table Guid
FoundAcpiTable = FALSE;
for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {
@@ -496,7 +330,7 @@ AcpiView (
if (ReportTableList != ReportOption) {
if (((ReportSelected == ReportOption) ||
(ReportDumpBinFile == ReportOption)) &&
- (!mSelectedAcpiTableFound)) {
+ (!SelectedTable->Found)) {
Print (L"\nRequested ACPI Table not found.\n");
} else if (GetConsistencyChecking () &&
(ReportDumpBinFile != ReportOption)) {
@@ -554,17 +388,12 @@ ShellCommandRunAcpiView (
CHAR16* ProblemParam;
SHELL_FILE_HANDLE TmpDumpFileHandle;
CONST CHAR16* MandatoryTableSpecStr;
+ CONST CHAR16 *SelectedTableName;
// Set Defaults
- mReportType = ReportAll;
mTableCount = 0;
mBinTableCount = 0;
- mSelectedAcpiTable = 0;
- mSelectedAcpiTableName = NULL;
- mSelectedAcpiTableFound = FALSE;
- mConsistencyCheck = TRUE;
- mMandatoryTableValidate = FALSE;
- mMandatoryTableSpec = 0;
+ AcpiConfigSetDefaults ();
ShellStatus = SHELL_SUCCESS;
Package = NULL;
@@ -671,25 +500,23 @@ ShellCommandRunAcpiView (
}
if (ShellCommandLineGetFlag (Package, L"-l")) {
- mReportType = ReportTableList;
+ SetReportOption (ReportTableList);
} else {
- mSelectedAcpiTableName = ShellCommandLineGetValue (Package, L"-s");
- if (mSelectedAcpiTableName != NULL) {
- mSelectedAcpiTable = (UINT32)ConvertStrToAcpiSignature (
- mSelectedAcpiTableName
- );
- mReportType = ReportSelected;
+ SelectedTableName = ShellCommandLineGetValue (Package, L"-s");
+ if (SelectedTableName != NULL) {
+ SelectAcpiTable (SelectedTableName);
+ SetReportOption (ReportSelected);
if (ShellCommandLineGetFlag (Package, L"-d")) {
// Create a temporary file to check if the media is writable.
CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN];
- mReportType = ReportDumpBinFile;
+ SetReportOption (ReportDumpBinFile);
UnicodeSPrint (
FileNameBuffer,
sizeof (FileNameBuffer),
L".\\%s%04d.tmp",
- mSelectedAcpiTableName,
+ SelectedTableName,
mBinTableCount
);
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
index be65564c86..92d64a8881 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
@@ -24,17 +24,6 @@
#define RSDP_LENGTH_OFFSET 20
/**
- The EREPORT_OPTION enum describes ACPI table Reporting options.
-**/
-typedef enum ReportOption {
- ReportAll, ///< Report All tables.
- ReportSelected, ///< Report Selected table.
- ReportTableList, ///< Report List of tables.
- ReportDumpBinFile, ///< Dump selected table to a file.
- ReportMax,
-} EREPORT_OPTION;
-
-/**
This function resets the ACPI table error counter to Zero.
**/
VOID
@@ -71,90 +60,6 @@ GetWarningCount (
);
/**
- This function returns the colour highlighting status.
-
- @retval TRUE if colour highlighting is enabled.
-**/
-BOOLEAN
-GetColourHighlighting (
- VOID
- );
-
-/**
- This function sets the colour highlighting status.
-
- @param Highlight The Highlight status.
-
-**/
-VOID
-SetColourHighlighting (
- BOOLEAN Highlight
- );
-
-/**
- This function returns the consistency checking status.
-
- @retval TRUE if consistency checking is enabled.
-**/
-BOOLEAN
-GetConsistencyChecking (
- VOID
- );
-
-/**
- This function sets the consistency checking status.
-
- @param ConsistencyChecking The consistency checking status.
-
-**/
-VOID
-SetConsistencyChecking (
- BOOLEAN ConsistencyChecking
- );
-
-/**
- This function returns the ACPI table requirements validation flag.
-
- @retval TRUE if check for mandatory table presence should be performed.
-**/
-BOOLEAN
-GetMandatoryTableValidate (
- VOID
- );
-
-/**
- This function sets the ACPI table requirements validation flag.
-
- @param Validate Enable/Disable ACPI table requirements validation.
-**/
-VOID
-SetMandatoryTableValidate (
- BOOLEAN Validate
- );
-
-/**
- This function returns the identifier of specification to validate ACPI table
- requirements against.
-
- @return ID of specification listing mandatory tables.
-**/
-UINTN
-GetMandatoryTableSpec (
- VOID
- );
-
-/**
- This function sets the identifier of specification to validate ACPI table
- requirements against.
-
- @param Spec ID of specification listing mandatory tables.
-**/
-VOID
-SetMandatoryTableSpec (
- UINTN Spec
- );
-
-/**
This function processes the table reporting options for the ACPI table.
@param [in] Signature The ACPI table Signature.
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c
new file mode 100644
index 0000000000..759a915928
--- /dev/null
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c
@@ -0,0 +1,246 @@
+/** @file
+ State and accessors for 'acpiview' configuration.
+
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+
+#include "AcpiViewConfig.h"
+
+// Report variables
+STATIC BOOLEAN mConsistencyCheck;
+STATIC BOOLEAN mColourHighlighting;
+STATIC EREPORT_OPTION mReportType;
+STATIC BOOLEAN mMandatoryTableValidate;
+STATIC UINTN mMandatoryTableSpec;
+
+// User selection of which ACPI table should be checked
+SELECTED_ACPI_TABLE mSelectedAcpiTable;
+
+/**
+ Reset the AcpiView user configuration to defaults
+**/
+VOID
+EFIAPI
+AcpiConfigSetDefaults (
+ VOID
+ )
+{
+ mReportType = ReportAll;
+ mSelectedAcpiTable.Type = 0;
+ mSelectedAcpiTable.Name = NULL;
+ mSelectedAcpiTable.Found = FALSE;
+ mConsistencyCheck = TRUE;
+ mMandatoryTableValidate = FALSE;
+ mMandatoryTableSpec = 0;
+}
+
+/**
+ This function converts a string to ACPI table signature.
+
+ @param [in] Str Pointer to the string to be converted to the
+ ACPI table signature.
+
+ @retval The ACPI table signature.
+**/
+STATIC
+UINT32
+ConvertStrToAcpiSignature (
+ IN CONST CHAR16 *Str
+ )
+{
+ UINT8 Index;
+ CHAR8 Ptr[4];
+
+ ZeroMem (Ptr, sizeof (Ptr));
+ Index = 0;
+
+ // Convert to Upper case and convert to ASCII
+ while ((Index < 4) && (Str[Index] != 0)) {
+ if (Str[Index] >= L'a' && Str[Index] <= L'z') {
+ Ptr[Index] = (CHAR8)(Str[Index] - (L'a' - L'A'));
+ } else {
+ Ptr[Index] = (CHAR8)Str[Index];
+ }
+ Index++;
+ }
+ return *(UINT32 *) Ptr;
+}
+
+/**
+ This function selects an ACPI table in current context.
+ The string name of the table is converted into UINT32
+ table signature.
+
+ @param [in] TableName The name of the ACPI table to select.
+**/
+VOID
+EFIAPI
+SelectAcpiTable (
+ IN CONST CHAR16 *TableName
+ )
+{
+ ASSERT (TableName != NULL);
+
+ mSelectedAcpiTable.Name = TableName;
+ mSelectedAcpiTable.Type = ConvertStrToAcpiSignature (mSelectedAcpiTable.Name);
+}
+
+/**
+ This function returns the selected ACPI table.
+
+ @param [out] SelectedAcpiTable Pointer that will contain the returned struct.
+**/
+VOID
+EFIAPI
+GetSelectedAcpiTable (
+ OUT SELECTED_ACPI_TABLE **SelectedAcpiTable
+ )
+{
+ *SelectedAcpiTable = &mSelectedAcpiTable;
+}
+
+/**
+ This function returns the colour highlighting status.
+
+ @retval TRUE Colour highlighting is enabled.
+**/
+BOOLEAN
+EFIAPI
+GetColourHighlighting (
+ VOID
+ )
+{
+ return mColourHighlighting;
+}
+
+/**
+ This function sets the colour highlighting status.
+
+ @param [in] Highlight The highlight status.
+**/
+VOID
+EFIAPI
+SetColourHighlighting (
+ BOOLEAN Highlight
+ )
+{
+ mColourHighlighting = Highlight;
+}
+
+/**
+ This function returns the consistency checking status.
+
+ @retval TRUE Consistency checking is enabled.
+**/
+BOOLEAN
+EFIAPI
+GetConsistencyChecking (
+ VOID
+ )
+{
+ return mConsistencyCheck;
+}
+
+/**
+ This function sets the consistency checking status.
+
+ @param [in] ConsistencyChecking The consistency checking status.
+**/
+VOID
+EFIAPI
+SetConsistencyChecking (
+ BOOLEAN ConsistencyChecking
+ )
+{
+ mConsistencyCheck = ConsistencyChecking;
+}
+
+/**
+ This function returns the report options.
+
+ @return The current report option.
+**/
+EREPORT_OPTION
+EFIAPI
+GetReportOption (
+ VOID
+ )
+{
+ return mReportType;
+}
+
+/**
+ This function sets the report options.
+
+ @param [in] ReportType The report option to set.
+**/
+VOID
+EFIAPI
+SetReportOption (
+ EREPORT_OPTION ReportType
+ )
+{
+ mReportType = ReportType;
+}
+
+/**
+ This function returns the ACPI table requirements validation flag.
+
+ @retval TRUE Check for mandatory table presence should be performed.
+**/
+BOOLEAN
+EFIAPI
+GetMandatoryTableValidate (
+ VOID
+ )
+{
+ return mMandatoryTableValidate;
+}
+
+/**
+ This function sets the ACPI table requirements validation flag.
+
+ @param [in] Validate Enable/Disable ACPI table requirements validation.
+**/
+VOID
+EFIAPI
+SetMandatoryTableValidate (
+ BOOLEAN Validate
+ )
+{
+ mMandatoryTableValidate = Validate;
+}
+
+/**
+ This function returns the identifier of specification to validate ACPI table
+ requirements against.
+
+ @return ID of specification listing mandatory tables.
+**/
+UINTN
+EFIAPI
+GetMandatoryTableSpec (
+ VOID
+ )
+{
+ return mMandatoryTableSpec;
+}
+
+/**
+ This function sets the identifier of specification to validate ACPI table
+ requirements against.
+
+ @param [in] Spec ID of specification listing mandatory tables.
+**/
+VOID
+EFIAPI
+SetMandatoryTableSpec (
+ UINTN Spec
+ )
+{
+ mMandatoryTableSpec = Spec;
+}
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h
new file mode 100644
index 0000000000..2db4a65415
--- /dev/null
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h
@@ -0,0 +1,177 @@
+/** @file
+ Header file for 'acpiview' configuration.
+
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef ACPI_VIEW_CONFIG_H_
+#define ACPI_VIEW_CONFIG_H_
+
+/**
+ This function returns the colour highlighting status.
+
+ @retval TRUE Colour highlighting is enabled.
+**/
+BOOLEAN
+EFIAPI
+GetColourHighlighting (
+ VOID
+ );
+
+/**
+ This function sets the colour highlighting status.
+
+ @param [in] Highlight The highlight status.
+**/
+VOID
+EFIAPI
+SetColourHighlighting (
+ BOOLEAN Highlight
+ );
+
+/**
+ This function returns the consistency checking status.
+
+ @retval TRUE Consistency checking is enabled.
+**/
+BOOLEAN
+EFIAPI
+GetConsistencyChecking (
+ VOID
+ );
+
+/**
+ This function sets the consistency checking status.
+
+ @param [in] ConsistencyChecking The consistency checking status.
+**/
+VOID
+EFIAPI
+SetConsistencyChecking (
+ BOOLEAN ConsistencyChecking
+ );
+
+/**
+ This function returns the ACPI table requirements validation flag.
+
+ @retval TRUE Check for mandatory table presence should be performed.
+**/
+BOOLEAN
+EFIAPI
+GetMandatoryTableValidate (
+ VOID
+ );
+
+/**
+ This function sets the ACPI table requirements validation flag.
+
+ @param [in] Validate Enable/Disable ACPI table requirements validation.
+**/
+VOID
+EFIAPI
+SetMandatoryTableValidate (
+ BOOLEAN Validate
+ );
+
+/**
+ This function returns the identifier of specification to validate ACPI table
+ requirements against.
+
+ @return ID of specification listing mandatory tables.
+**/
+UINTN
+EFIAPI
+GetMandatoryTableSpec (
+ VOID
+ );
+
+/**
+ This function sets the identifier of specification to validate ACPI table
+ requirements against.
+
+ @param [in] Spec ID of specification listing mandatory tables.
+**/
+VOID
+EFIAPI
+SetMandatoryTableSpec (
+ UINTN Spec
+ );
+
+/**
+ The EREPORT_OPTION enum describes ACPI table Reporting options.
+**/
+typedef enum {
+ ReportAll, ///< Report All tables.
+ ReportSelected, ///< Report Selected table.
+ ReportTableList, ///< Report List of tables.
+ ReportDumpBinFile, ///< Dump selected table to a file.
+ ReportMax,
+} EREPORT_OPTION;
+
+/**
+ This function returns the report options.
+
+ @return The current report option.
+**/
+EREPORT_OPTION
+EFIAPI
+GetReportOption (
+ VOID
+ );
+
+/**
+ This function sets the report options.
+
+ @param [in] ReportType The report option to set.
+**/
+VOID
+EFIAPI
+SetReportOption (
+ EREPORT_OPTION ReportType
+ );
+
+/**
+ A structure holding the user selection detailing which
+ ACPI table is to be examined by the AcpiView code.
+**/
+typedef struct {
+ UINT32 Type; ///< 32bit signature of the selected ACPI table.
+ CONST CHAR16* Name; ///< User friendly name of the selected ACPI table.
+ BOOLEAN Found; ///< The selected table has been found in the system.
+} SELECTED_ACPI_TABLE;
+
+/**
+ This function returns the selected ACPI table.
+
+ @param [out] SelectedAcpiTable Pointer that will contain the returned struct.
+**/
+VOID
+EFIAPI
+GetSelectedAcpiTable (
+ OUT SELECTED_ACPI_TABLE** SelectedAcpiTable
+ );
+
+/**
+ This function selects an ACPI table in current context.
+ The string name of the table is converted into UINT32
+ table signature.
+
+ @param [in] TableName The name of the ACPI table to select.
+**/
+VOID
+EFIAPI
+SelectAcpiTable (
+ CONST CHAR16* TableName
+ );
+
+/**
+ Reset the AcpiView user configuration to defaults.
+**/
+VOID
+EFIAPI
+AcpiConfigSetDefaults (
+ VOID
+ );
+
+#endif // ACPI_VIEW_CONFIG_H_
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
index bdd30ff45c..d02fc4929d 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
@@ -12,6 +12,7 @@
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
+#include "AcpiViewConfig.h"
// "The number of GT Block Timers must be less than or equal to 8"
#define GT_BLOCK_TIMER_COUNT_MAX 8
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
index 9a006a0144..f7447947b2 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
@@ -13,6 +13,7 @@
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
+#include "AcpiViewConfig.h"
// Local variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c
index f85d2b3653..15aa2392b6 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c
@@ -15,6 +15,7 @@
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
+#include "AcpiViewConfig.h"
#include "MadtParser.h"
// Local Variables
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
index 0db272c16a..acd2b81bb3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
@@ -13,6 +13,7 @@
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"
+#include "AcpiViewConfig.h"
#include "PpttParser.h"
// Local variables
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
index 6f66be68cc..b9b67820b8 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
@@ -13,6 +13,7 @@
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
+#include "AcpiViewConfig.h"
// Local Variables
STATIC CONST UINT8* SratRAType;
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
index d21ecd40a8..92de2391b0 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
@@ -19,15 +19,14 @@
DESTRUCTOR = UefiShellAcpiViewCommandLibDestructor
[Sources.common]
- UefiShellAcpiViewCommandLib.uni
- UefiShellAcpiViewCommandLib.c
- UefiShellAcpiViewCommandLib.h
- AcpiParser.h
- AcpiTableParser.h
- AcpiView.h
AcpiParser.c
+ AcpiParser.h
AcpiTableParser.c
+ AcpiTableParser.h
AcpiView.c
+ AcpiView.h
+ AcpiViewConfig.c
+ AcpiViewConfig.h
Parsers/Bgrt/BgrtParser.c
Parsers/Dbg2/Dbg2Parser.c
Parsers/Dsdt/DsdtParser.c
@@ -36,40 +35,43 @@
Parsers/Gtdt/GtdtParser.c
Parsers/Iort/IortParser.c
Parsers/Madt/MadtParser.c
+ Parsers/Madt/MadtParser.h
Parsers/Mcfg/McfgParser.c
Parsers/Pptt/PpttParser.c
+ Parsers/Pptt/PpttParser.h
Parsers/Rsdp/RsdpParser.c
Parsers/Slit/SlitParser.c
Parsers/Spcr/SpcrParser.c
Parsers/Srat/SratParser.c
Parsers/Ssdt/SsdtParser.c
Parsers/Xsdt/XsdtParser.c
- Parsers/Madt/MadtParser.h
- Parsers/Pptt/PpttParser.h
+ UefiShellAcpiViewCommandLib.c
+ UefiShellAcpiViewCommandLib.h
+ UefiShellAcpiViewCommandLib.uni
[Sources.ARM, Sources.AARCH64]
Arm/SbbrValidator.h
Arm/SbbrValidator.c
[Packages]
+ MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
- MemoryAllocationLib
BaseLib
BaseMemoryLib
DebugLib
+ FileHandleLib
+ HiiLib
+ MemoryAllocationLib
+ PcdLib
+ PrintLib
ShellCommandLib
ShellLib
+ UefiBootServicesTableLib
UefiLib
UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- PcdLib
- HiiLib
- PrintLib
- FileHandleLib
[FixedPcd]