summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2021-02-19 12:05:59 +0530
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-02-23 15:40:37 +0000
commit053cd5980cdb1ec1f5ac744100bb94df3018395c (patch)
tree3040acb665f71b56c96af594c7c25a8aa7fe831e /StandaloneMmPkg
parent2385e1deca5d842bb31cfab0bcfedaa356a3ca8e (diff)
downloadedk2-053cd5980cdb1ec1f5ac744100bb94df3018395c.tar.gz
edk2-053cd5980cdb1ec1f5ac744100bb94df3018395c.tar.bz2
edk2-053cd5980cdb1ec1f5ac744100bb94df3018395c.zip
StandaloneMmPkg: Use macros for SPM version check
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>
Diffstat (limited to 'StandaloneMmPkg')
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
index 3d78e8e9ae..2643473e88 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
@@ -32,8 +32,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define SPM_MINOR_VER_MASK 0x0000FFFF
#define SPM_MAJOR_VER_SHIFT 16
-#define SPM_MAJOR_VER 0
-#define SPM_MINOR_VER 1
+STATIC CONST UINT32 mSpmMajorVer = SPM_MAJOR_VERSION;
+STATIC CONST UINT32 mSpmMinorVer = SPM_MINOR_VERSION;
#define BOOT_PAYLOAD_VERSION 1
@@ -196,8 +196,8 @@ GetSpmVersion (VOID)
// revision A must work in a compatible way with revision B.
// However, it is possible for revision B to have a higher
// function count than revision A.
- if ((SpmMajorVersion == SPM_MAJOR_VER) &&
- (SpmMinorVersion >= SPM_MINOR_VER))
+ if ((SpmMajorVersion == mSpmMajorVer) &&
+ (SpmMinorVersion >= mSpmMinorVer))
{
DEBUG ((DEBUG_INFO, "SPM Version: Major=0x%x, Minor=0x%x\n",
SpmMajorVersion, SpmMinorVersion));
@@ -206,7 +206,7 @@ GetSpmVersion (VOID)
else
{
DEBUG ((DEBUG_INFO, "Incompatible SPM Versions.\n Current Version: Major=0x%x, Minor=0x%x.\n Expected: Major=0x%x, Minor>=0x%x.\n",
- SpmMajorVersion, SpmMinorVersion, SPM_MAJOR_VER, SPM_MINOR_VER));
+ SpmMajorVersion, SpmMinorVersion, mSpmMajorVer, mSpmMinorVer));
Status = EFI_UNSUPPORTED;
}