]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg: Use macros for SPM version check
authorSughosh Ganu <sughosh.ganu@linaro.org>
Fri, 19 Feb 2021 06:35:59 +0000 (12:05 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 23 Feb 2021 15:40:37 +0000 (15:40 +0000)
Declare module wide variables for SPM major and minor versions to be
used in checking the SPM version compatibility. Use the SPM major and
minor version macros declared in the previous patch for the version
check.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c

index 3d78e8e9ae44d218fa1b39270ba7167e4c665d83..2643473e88973298b9df75b4740dfaa73bcecb52 100644 (file)
@@ -32,8 +32,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SPM_MINOR_VER_MASK        0x0000FFFF\r
 #define SPM_MAJOR_VER_SHIFT       16\r
 \r
-#define SPM_MAJOR_VER             0\r
-#define SPM_MINOR_VER             1\r
+STATIC CONST UINT32 mSpmMajorVer = SPM_MAJOR_VERSION;\r
+STATIC CONST UINT32 mSpmMinorVer = SPM_MINOR_VERSION;\r
 \r
 #define BOOT_PAYLOAD_VERSION      1\r
 \r
@@ -196,8 +196,8 @@ GetSpmVersion (VOID)
   // revision A must work in a compatible way with revision B.\r
   // However, it is possible for revision B to have a higher\r
   // function count than revision A.\r
-  if ((SpmMajorVersion == SPM_MAJOR_VER) &&\r
-      (SpmMinorVersion >= SPM_MINOR_VER))\r
+  if ((SpmMajorVersion == mSpmMajorVer) &&\r
+      (SpmMinorVersion >= mSpmMinorVer))\r
   {\r
     DEBUG ((DEBUG_INFO, "SPM Version: Major=0x%x, Minor=0x%x\n",\r
            SpmMajorVersion, SpmMinorVersion));\r
@@ -206,7 +206,7 @@ GetSpmVersion (VOID)
   else\r
   {\r
     DEBUG ((DEBUG_INFO, "Incompatible SPM Versions.\n Current Version: Major=0x%x, Minor=0x%x.\n Expected: Major=0x%x, Minor>=0x%x.\n",\r
-            SpmMajorVersion, SpmMinorVersion, SPM_MAJOR_VER, SPM_MINOR_VER));\r
+            SpmMajorVersion, SpmMinorVersion, mSpmMajorVer, mSpmMinorVer));\r
     Status = EFI_UNSUPPORTED;\r
   }\r
 \r