summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-06-28 16:56:58 +0800
committerRay Ni <ray.ni@intel.com>2019-07-02 17:22:45 +0800
commitf73843d56d0c121fcb3021e7a138f48584c63a49 (patch)
treef05fabbcdff820c15a0f4d4abbf1ead82656dcfb /ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
parent3d3144350237017e3260bf37fbcc0ed30d2da5be (diff)
downloadedk2-f73843d56d0c121fcb3021e7a138f48584c63a49.tar.gz
edk2-f73843d56d0c121fcb3021e7a138f48584c63a49.tar.bz2
edk2-f73843d56d0c121fcb3021e7a138f48584c63a49.zip
ShellPkg: acpiview: Allow disabling consistency checks (-q flag)
The current documentation for the acpiview UEFI shell tool states that the '-c' flag enables consistency checks on ACPI table data. However, these checks are enabled anyway by default. This patch keeps ACPI table validation as a default option, but it makes it possible to turn ACPI table validation off by setting the newly-introduced '-q' flag. Consequently, the '-c' flag is removed. The remaining code changes in this patch make a number of consistency checks optional (but enabled by default): 1. ACPI table field offset mismatch. 2. ACPI table field validation functions provided in the ACPI_PARSER arrays. 3. Table checksum computation. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
index 9bbb00caca..e99537acf3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
@@ -33,7 +33,7 @@ STATIC BOOLEAN mColourHighlighting;
An array of acpiview command line parameters.
**/
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-c", TypeFlag},
+ {L"-q", TypeFlag},
{L"-d", TypeFlag},
{L"-h", TypeValue},
{L"-l", TypeFlag},
@@ -70,6 +70,33 @@ SetColourHighlighting (
}
/**
+ 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 report options.
@retval Returns the report option.
@@ -380,7 +407,8 @@ AcpiView (
(ReportDumpBinFile == ReportOption)) &&
(!mSelectedAcpiTableFound)) {
Print (L"\nRequested ACPI Table not found.\n");
- } else if (ReportDumpBinFile != ReportOption) {
+ } else if (GetConsistencyChecking () &&
+ (ReportDumpBinFile != ReportOption)) {
OriginalAttribute = gST->ConOut->Mode->Attribute;
Print (L"\nTable Statistics:\n");
@@ -554,6 +582,9 @@ ShellCommandRunAcpiView (
}
}
+ // Surpress consistency checking if requested
+ SetConsistencyChecking (!ShellCommandLineGetFlag (Package, L"-q"));
+
if (ShellCommandLineGetFlag (Package, L"-l")) {
mReportType = ReportTableList;
} else {