]> xenbits.xensource.com Git - ovmf.git/commitdiff
OvmfPkg: Rename IS_ALIGNED macros to avoid name collisions
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 22 Mar 2023 07:02:39 +0000 (00:02 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 1 Apr 2023 23:11:44 +0000 (23:11 +0000)
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>
OvmfPkg/AmdSevDxe/AmdSevDxe.c
OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c

index a726498e27923424fdc496685a267f09c8cc4daa..71a1eaaf0a1dd0ed6011a26f2301d83d9ef7c502 100644 (file)
@@ -44,7 +44,7 @@ STATIC BOOLEAN  mAcceptAllMemoryAtEBS = TRUE;
 \r
 STATIC EFI_EVENT  mAcceptAllMemoryEvent = NULL;\r
 \r
-#define IS_ALIGNED(x, y)  ((((x) & ((y) - 1)) == 0))\r
+#define IS_ALIGNED_(x, y)  ((((x) & ((y) - 1)) == 0))\r
 \r
 STATIC\r
 EFI_STATUS\r
@@ -60,8 +60,8 @@ AmdSevMemoryAccept (
   // multiple of SIZE_4KB. Use an assert instead of returning an erros since\r
   // this is an EDK2-internal protocol.\r
   //\r
-  ASSERT (IS_ALIGNED (StartAddress, SIZE_4KB));\r
-  ASSERT (IS_ALIGNED (Size, SIZE_4KB));\r
+  ASSERT (IS_ALIGNED_ (StartAddress, SIZE_4KB));\r
+  ASSERT (IS_ALIGNED_ (Size, SIZE_4KB));\r
   ASSERT (Size != 0);\r
 \r
   MemEncryptSevSnpPreValidateSystemRam (\r
index 4d684964d8382ea40876d7a323125397676c5a92..f35bba5deb4669175887ea13e00df3b7cd034775 100644 (file)
@@ -20,7 +20,7 @@
 \r
 #include "SnpPageStateChange.h"\r
 \r
-#define IS_ALIGNED(x, y)  ((((x) & (y - 1)) == 0))\r
+#define IS_ALIGNED_(x, y)  ((((x) & (y - 1)) == 0))\r
 #define PAGES_PER_LARGE_ENTRY  512\r
 \r
 STATIC\r
@@ -150,7 +150,7 @@ BuildPageStateBuffer (
     //\r
     // Is this a 2MB aligned page? Check if we can use the Large RMP entry.\r
     //\r
-    if (UseLargeEntry && IS_ALIGNED (BaseAddress, SIZE_2MB) &&\r
+    if (UseLargeEntry && IS_ALIGNED_ (BaseAddress, SIZE_2MB) &&\r
         ((EndAddress - BaseAddress) >= SIZE_2MB))\r
     {\r
       RmpPageSize = PvalidatePageSize2MB;\r