Skip to content

Commit

Permalink
OvmfPkg: Rename IS_ALIGNED macros to avoid name collisions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kraxel authored and mergify[bot] committed Apr 1, 2023
1 parent 583f1ab commit 24e6daa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions OvmfPkg/AmdSevDxe/AmdSevDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 24e6daa

Please sign in to comment.