Skip to content

Commit 4d83ee0

Browse files
Edward Pickupmergify[bot]
authored andcommitted
ShellPkg: Add revision check for DSDT Header on Arm
Bugzilla: 3995 (https://bugzilla.tianocore.org/show_bug.cgi?id=3995) ACPI 6.4 spec states that if the revision field in the DSDT header is less than 2, then all integers are restricted in width to 32 bits, including in SSDTs. Arm Base boot requirements state that platforms must conform to ACPI 6.3 or later, and that legacy tables are not supported. Adds a check for this field and raise warning if revision is less than 2 on arm. Signed-off-by: Edward Pickup <[email protected]> Reviewed-by: Zhichao Gao <[email protected]>
1 parent dfdba85 commit 4d83ee0

File tree

1 file changed

+17
-1
lines changed
  • ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt

1 file changed

+17
-1
lines changed

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @file
22
DSDT table parser
33
4-
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
4+
Copyright (c) 2016 - 2022, ARM Limited. All rights reserved.
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
77
@par Reference(s):
@@ -39,4 +39,20 @@ ParseAcpiDsdt (
3939
}
4040

4141
DumpAcpiHeader (Ptr);
42+
43+
// As per 19.6.29 in the version 6.4 of the ACPI spec, a revision less than 2
44+
// restricts integers to 32 bit width. This may not be intended, raise a
45+
// warning
46+
#if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
47+
if (AcpiTableRevision < 2) {
48+
IncrementWarningCount ();
49+
Print (
50+
L"WARNING: DSDT Table Revision less than 2. Integer width restricted to "
51+
L"32 bits. Table Revision = %d.\n",
52+
AcpiTableRevision
53+
);
54+
return;
55+
}
56+
57+
#endif
4258
}

0 commit comments

Comments
 (0)