]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Add revision check for DSDT Header on Arm
authorEdward Pickup <edward.pickup@arm.com>
Wed, 20 Jul 2022 08:59:49 +0000 (16:59 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 24 Aug 2022 03:14:52 +0000 (03:14 +0000)
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 <edward.pickup@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c

index e75e4622239ed03b171adc92d32b5eeb75a8edef..7f30a8409bb711d4edf77ed04319c628ef8aea73 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DSDT table parser\r
 \r
-  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
+  Copyright (c) 2016 - 2022, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   @par Reference(s):\r
@@ -39,4 +39,20 @@ ParseAcpiDsdt (
   }\r
 \r
   DumpAcpiHeader (Ptr);\r
+\r
+  // As per 19.6.29 in the version 6.4 of the ACPI spec, a revision less than 2\r
+  // restricts integers to 32 bit width. This may not be intended, raise a\r
+  // warning\r
+ #if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)\r
+  if (AcpiTableRevision < 2) {\r
+    IncrementWarningCount ();\r
+    Print (\r
+      L"WARNING: DSDT Table Revision less than 2. Integer width restricted to "\r
+      L"32 bits. Table Revision = %d.\n",\r
+      AcpiTableRevision\r
+      );\r
+    return;\r
+  }\r
+\r
+ #endif\r
 }\r