diff options
author | Sami Mujawar <sami.mujawar@arm.com> | 2020-09-24 10:51:34 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-11 02:21:23 +0000 |
commit | 856cf5abf701c148a07e21660feff5f8ccf7fb79 (patch) | |
tree | f2ffa059e0b18da2fa8b88f40e99fbc89b9bbd7f /ShellPkg | |
parent | 10dc8c561c687c9e73e29743d04d828cca56a288 (diff) | |
download | edk2-856cf5abf701c148a07e21660feff5f8ccf7fb79.tar.gz |
ShellPkg/AcpiView: Fix field validator invocation
Bugzilla: 3046 (https://bugzilla.tianocore.org/show_bug.cgi?id=3046)
The field validator function provides means to validate fields
in the ACPI table structures. To print complex field types a
print formatter function is provided.
The field validator was being invoked for simple data fields
for which the default print format is used. However, the field
validator function was not invoked if a print formatter function
was provided.
This problem is noticed when a Generic Address Structure (GAS)
is printed using DumpGas() and a field validator is present
to validate the GAS structure.
To fix this move the invocation of the field validator after
the field is printed such that the validation function is
called even when a print formatter function is present.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index 02f6d771c7..01ac9a9baf 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -1,7 +1,7 @@ /** @file
ACPI parser
- Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -596,13 +596,12 @@ ParseAcpi ( Parser[Index].Length
);
} // switch
-
- // Validating only makes sense if we are tracing
- // the parsed table entries, to report by table name.
- if (GetConsistencyChecking () &&
- (Parser[Index].FieldValidator != NULL)) {
- Parser[Index].FieldValidator (Ptr, Parser[Index].Context);
- }
+ }
+ // Validating only makes sense if we are tracing
+ // the parsed table entries, to report by table name.
+ if (GetConsistencyChecking () &&
+ (Parser[Index].FieldValidator != NULL)) {
+ Parser[Index].FieldValidator (Ptr, Parser[Index].Context);
}
Print (L"\n");
} // if (Trace)
|