diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-03-22 00:02:39 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-01 23:11:44 +0000 |
commit | 24e6daa2bcfb64bbe871f76d8e9774d67f247717 (patch) | |
tree | aab9c204d061385c713f9dd51b6ccf61438d22b2 | |
parent | 583f1aba8b97695ebba8a9f03de0883e6d2dcd1f (diff) | |
download | edk2-24e6daa2bcfb64bbe871f76d8e9774d67f247717.tar.gz edk2-24e6daa2bcfb64bbe871f76d8e9774d67f247717.tar.bz2 edk2-24e6daa2bcfb64bbe871f76d8e9774d67f247717.zip |
OvmfPkg: Rename IS_ALIGNED macros to avoid name collisions
This patch is a preparation for the patches that follow. The
subsequent patches will introduce and integrate new alignment-related
macros, which collide with existing definitions in OvmfPkg.
Temporarily rename them to avoid build failure, till they can be
substituted with the new, shared definitions.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
-rw-r--r-- | OvmfPkg/AmdSevDxe/AmdSevDxe.c | 6 | ||||
-rw-r--r-- | OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index a726498e27..71a1eaaf0a 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -44,7 +44,7 @@ STATIC BOOLEAN mAcceptAllMemoryAtEBS = TRUE; STATIC EFI_EVENT mAcceptAllMemoryEvent = NULL;
-#define IS_ALIGNED(x, y) ((((x) & ((y) - 1)) == 0))
+#define IS_ALIGNED_(x, y) ((((x) & ((y) - 1)) == 0))
STATIC
EFI_STATUS
@@ -60,8 +60,8 @@ AmdSevMemoryAccept ( // multiple of SIZE_4KB. Use an assert instead of returning an erros since
// this is an EDK2-internal protocol.
//
- ASSERT (IS_ALIGNED (StartAddress, SIZE_4KB));
- ASSERT (IS_ALIGNED (Size, SIZE_4KB));
+ ASSERT (IS_ALIGNED_ (StartAddress, SIZE_4KB));
+ ASSERT (IS_ALIGNED_ (Size, SIZE_4KB));
ASSERT (Size != 0);
MemEncryptSevSnpPreValidateSystemRam (
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c index 4d684964d8..f35bba5deb 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c @@ -20,7 +20,7 @@ #include "SnpPageStateChange.h"
-#define IS_ALIGNED(x, y) ((((x) & (y - 1)) == 0))
+#define IS_ALIGNED_(x, y) ((((x) & (y - 1)) == 0))
#define PAGES_PER_LARGE_ENTRY 512
STATIC
@@ -150,7 +150,7 @@ BuildPageStateBuffer ( //
// Is this a 2MB aligned page? Check if we can use the Large RMP entry.
//
- if (UseLargeEntry && IS_ALIGNED (BaseAddress, SIZE_2MB) &&
+ if (UseLargeEntry && IS_ALIGNED_ (BaseAddress, SIZE_2MB) &&
((EndAddress - BaseAddress) >= SIZE_2MB))
{
RmpPageSize = PvalidatePageSize2MB;
|