summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorMarvin Häuser <mhaeuser@posteo.de>2023-03-22 00:02:38 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-01 23:11:44 +0000
commit583f1aba8b97695ebba8a9f03de0883e6d2dcd1f (patch)
treee7838c5e5cbdc7385bba43193bd3b8ae42744bd9 /MdeModulePkg/Universal
parent67a6f414aa0e2a9cac965fcc6d83b6cbd6e893c0 (diff)
downloadedk2-583f1aba8b97695ebba8a9f03de0883e6d2dcd1f.tar.gz
edk2-583f1aba8b97695ebba8a9f03de0883e6d2dcd1f.tar.bz2
edk2-583f1aba8b97695ebba8a9f03de0883e6d2dcd1f.zip
MdeModulePkg: 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 MdeModulePkg. Temporarily rename them to avoid build failure, till they can be substituted with the new, shared definitions. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Marvin Häuser <mhaeuser@posteo.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcExecute.c36
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcExecute.h4
2 files changed, 20 insertions, 20 deletions
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
index 82a7782fb9..28f108c448 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
@@ -2015,7 +2015,7 @@ ExecuteJMP (
// check for alignment, and jump absolute.
//
Data64 = (UINT64)VmReadImmed64 (VmPtr, 2);
- if (!IS_ALIGNED ((UINTN)Data64, sizeof (UINT16))) {
+ if (!ADDRESS_IS_ALIGNED_ ((UINTN)Data64, sizeof (UINT16))) {
EbcDebugSignalException (
EXCEPT_EBC_ALIGNMENT_CHECK,
EXCEPTION_FLAG_FATAL,
@@ -2074,7 +2074,7 @@ ExecuteJMP (
// Form: JMP32 @Rx {Index32}
//
Addr = VmReadMemN (VmPtr, (UINTN)Data64 + Index32);
- if (!IS_ALIGNED ((UINTN)Addr, sizeof (UINT16))) {
+ if (!ADDRESS_IS_ALIGNED_ ((UINTN)Addr, sizeof (UINT16))) {
EbcDebugSignalException (
EXCEPT_EBC_ALIGNMENT_CHECK,
EXCEPTION_FLAG_FATAL,
@@ -2097,7 +2097,7 @@ ExecuteJMP (
// Form: JMP32 Rx {Immed32}
//
Addr = (UINTN)(Data64 + Index32);
- if (!IS_ALIGNED ((UINTN)Addr, sizeof (UINT16))) {
+ if (!ADDRESS_IS_ALIGNED_ ((UINTN)Addr, sizeof (UINT16))) {
EbcDebugSignalException (
EXCEPT_EBC_ALIGNMENT_CHECK,
EXCEPTION_FLAG_FATAL,
@@ -3158,7 +3158,7 @@ ExecuteRET (
// Pull the return address off the VM app's stack and set the IP
// to it
//
- if (!IS_ALIGNED ((UINTN)VmPtr->Gpr[0], sizeof (UINT16))) {
+ if (!ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Gpr[0], sizeof (UINT16))) {
EbcDebugSignalException (
EXCEPT_EBC_ALIGNMENT_CHECK,
EXCEPTION_FLAG_FATAL,
@@ -4733,7 +4733,7 @@ VmWriteMem16 (
//
// Do a simple write if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT16))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT16))) {
*(UINT16 *)Addr = Data;
} else {
//
@@ -4795,7 +4795,7 @@ VmWriteMem32 (
//
// Do a simple write if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT32))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT32))) {
*(UINT32 *)Addr = Data;
} else {
//
@@ -4857,7 +4857,7 @@ VmWriteMem64 (
//
// Do a simple write if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT64))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT64))) {
*(UINT64 *)Addr = Data;
} else {
//
@@ -4922,7 +4922,7 @@ VmWriteMemN (
//
// Do a simple write if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINTN))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINTN))) {
*(UINTN *)Addr = Data;
} else {
for (Index = 0; Index < sizeof (UINTN) / sizeof (UINT32); Index++) {
@@ -4985,7 +4985,7 @@ VmReadImmed16 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (INT16))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (INT16))) {
return *(INT16 *)(VmPtr->Ip + Offset);
} else {
//
@@ -5029,7 +5029,7 @@ VmReadImmed32 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT32))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (UINT32))) {
return *(INT32 *)(VmPtr->Ip + Offset);
}
@@ -5068,7 +5068,7 @@ VmReadImmed64 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT64))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (UINT64))) {
return *(UINT64 *)(VmPtr->Ip + Offset);
}
@@ -5105,7 +5105,7 @@ VmReadCode16 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT16))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (UINT16))) {
return *(UINT16 *)(VmPtr->Ip + Offset);
} else {
//
@@ -5147,7 +5147,7 @@ VmReadCode32 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT32))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (UINT32))) {
return *(UINT32 *)(VmPtr->Ip + Offset);
}
@@ -5184,7 +5184,7 @@ VmReadCode64 (
//
// Read direct if aligned
//
- if (IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT64))) {
+ if (ADDRESS_IS_ALIGNED_ ((UINTN)VmPtr->Ip + Offset, sizeof (UINT64))) {
return *(UINT64 *)(VmPtr->Ip + Offset);
}
@@ -5247,7 +5247,7 @@ VmReadMem16 (
//
// Read direct if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT16))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT16))) {
return *(UINT16 *)Addr;
}
@@ -5281,7 +5281,7 @@ VmReadMem32 (
//
// Read direct if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT32))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT32))) {
return *(UINT32 *)Addr;
}
@@ -5319,7 +5319,7 @@ VmReadMem64 (
//
// Read direct if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINT64))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINT64))) {
return *(UINT64 *)Addr;
}
@@ -5388,7 +5388,7 @@ VmReadMemN (
//
// Read direct if aligned
//
- if (IS_ALIGNED (Addr, sizeof (UINTN))) {
+ if (ADDRESS_IS_ALIGNED_ (Addr, sizeof (UINTN))) {
return *(UINTN *)Addr;
}
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
index 32b8670c5b..6dc6730ab0 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
+++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
@@ -14,8 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Macros to check and set alignment
//
-#define ASSERT_ALIGNED(addr, size) ASSERT (!((UINT32) (addr) & (size - 1)))
-#define IS_ALIGNED(addr, size) !((UINT32) (addr) & (size - 1))
+#define ASSERT_ALIGNED(addr, size) ASSERT (!((UINT32) (addr) & (size - 1)))
+#define ADDRESS_IS_ALIGNED_(addr, size) !((UINT32) (addr) & (size - 1))
//
// Debug macro