diff options
author | Marvin Häuser <mhaeuser@posteo.de> | 2023-03-22 00:02:38 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-01 23:11:44 +0000 |
commit | 583f1aba8b97695ebba8a9f03de0883e6d2dcd1f (patch) | |
tree | e7838c5e5cbdc7385bba43193bd3b8ae42744bd9 /MdeModulePkg/Bus | |
parent | 67a6f414aa0e2a9cac965fcc6d83b6cbd6e893c0 (diff) | |
download | edk2-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/Bus')
-rw-r--r-- | MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h | 4 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c | 6 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 12 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 4 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 6 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h | 2 |
12 files changed, 23 insertions, 23 deletions
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c index 7b97887c5d..d93fa78c81 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c @@ -2126,7 +2126,7 @@ TrustTransferAtaDevice ( // ATA PassThru PPI.
//
if ((AtaPassThru->Mode->IoAlign > 1) &&
- !IS_ALIGNED (Buffer, AtaPassThru->Mode->IoAlign))
+ !ADDRESS_IS_ALIGNED_ (Buffer, AtaPassThru->Mode->IoAlign))
{
NewBuffer = AllocateAlignedPages (
EFI_SIZE_TO_PAGES (TransferLength),
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h index 4aed1cb7ad..71d34c962a 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h @@ -146,8 +146,8 @@ typedef union { #define AHCI_PORT_SERR 0x0030
#define AHCI_PORT_CI 0x0038
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
-#define TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
#pragma pack(1)
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c index d5ed93dc4f..0c49059a00 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c @@ -194,15 +194,15 @@ AhciAtaPassThruPassThru ( }
IoAlign = This->Mode->IoAlign;
- if ((IoAlign > 1) && !IS_ALIGNED (Packet->InDataBuffer, IoAlign)) {
+ if ((IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->InDataBuffer, IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((IoAlign > 1) && !IS_ALIGNED (Packet->OutDataBuffer, IoAlign)) {
+ if ((IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->OutDataBuffer, IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((IoAlign > 1) && !IS_ALIGNED (Packet->Asb, IoAlign)) {
+ if ((IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->Asb, IoAlign)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index 1070516b35..324abadd02 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -1299,15 +1299,15 @@ AtaPassThruPassThru ( Instance = ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS (This);
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->InDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->InDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->OutDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->OutDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->Asb, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->Asb, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
@@ -2039,15 +2039,15 @@ ExtScsiPassThruPassThru ( return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->InDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->InDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->OutDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->OutDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->SenseData, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->SenseData, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h index 62ba6d6680..7937886614 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h @@ -148,7 +148,7 @@ struct _ATA_NONBLOCK_TASK { #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)
#define ATA_SPINUP_TIMEOUT EFI_TIMER_PERIOD_SECONDS(10)
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
#define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
CR (a, \
diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h index 4428c484fd..47346e911d 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h @@ -76,7 +76,7 @@ #define ATA_TASK_SIGNATURE SIGNATURE_32 ('A', 'T', 'S', 'K')
#define ATA_DEVICE_SIGNATURE SIGNATURE_32 ('A', 'B', 'I', 'D')
#define ATA_SUB_TASK_SIGNATURE SIGNATURE_32 ('A', 'S', 'T', 'S')
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
//
// ATA bus data structure for ATA controller
diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c index 4334169d25..18aa4f9bb6 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c @@ -1040,7 +1040,7 @@ TrustTransferAtaDevice ( // Check the alignment of the incoming buffer prior to invoking underlying ATA PassThru
//
AtaPassThru = AtaDevice->AtaBusDriverData->AtaPassThru;
- if ((AtaPassThru->Mode->IoAlign > 1) && !IS_ALIGNED (Buffer, AtaPassThru->Mode->IoAlign)) {
+ if ((AtaPassThru->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Buffer, AtaPassThru->Mode->IoAlign)) {
NewBuffer = AllocateAlignedBuffer (AtaDevice, TransferLength);
if (NewBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index fbc236cb46..faf4ae332e 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -2029,7 +2029,7 @@ ScsiDiskReceiveData ( goto Done;
}
- if ((ScsiDiskDevice->ScsiIo->IoAlign > 1) && !IS_ALIGNED (PayloadBuffer, ScsiDiskDevice->ScsiIo->IoAlign)) {
+ if ((ScsiDiskDevice->ScsiIo->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (PayloadBuffer, ScsiDiskDevice->ScsiIo->IoAlign)) {
AlignedBuffer = AllocateAlignedBuffer (ScsiDiskDevice, PayloadBufferSize);
if (AlignedBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -2249,7 +2249,7 @@ ScsiDiskSendData ( goto Done;
}
- if ((ScsiDiskDevice->ScsiIo->IoAlign > 1) && !IS_ALIGNED (PayloadBuffer, ScsiDiskDevice->ScsiIo->IoAlign)) {
+ if ((ScsiDiskDevice->ScsiIo->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (PayloadBuffer, ScsiDiskDevice->ScsiIo->IoAlign)) {
AlignedBuffer = AllocateAlignedBuffer (ScsiDiskDevice, PayloadBufferSize);
if (AlignedBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h index 5b4047e1db..ed384ad521 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h @@ -38,7 +38,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define IS_DEVICE_FIXED(a) (a)->FixedDevice ? 1 : 0
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
#define UFS_WLUN_RPMB 0xC4
diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h index a0b615b7ea..1adb382aa8 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h @@ -133,7 +133,7 @@ typedef struct _UFS_PEIM_HC_PRIVATE_DATA { #define ROUNDUP8(x) (((x) % 8 == 0) ? (x) : ((x) / 8 + 1) * 8)
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
#define GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS(a) CR (a, UFS_PEIM_HC_PRIVATE_DATA, BlkIoPpi, UFS_PEIM_HC_SIG)
#define GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS2(a) CR (a, UFS_PEIM_HC_PRIVATE_DATA, BlkIo2Ppi, UFS_PEIM_HC_SIG)
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c index ae593ff03a..392a295caf 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c @@ -171,15 +171,15 @@ UfsPassThruPassThru ( return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->InDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->InDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->OutDataBuffer, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->OutDataBuffer, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
- if ((This->Mode->IoAlign > 1) && !IS_ALIGNED (Packet->SenseData, This->Mode->IoAlign)) {
+ if ((This->Mode->IoAlign > 1) && !ADDRESS_IS_ALIGNED_ (Packet->SenseData, This->Mode->IoAlign)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h index 2b4f5d32d9..0ec37e5665 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h @@ -105,7 +105,7 @@ typedef struct { #define ROUNDUP8(x) (((x) % 8 == 0) ? (x) : ((x) / 8 + 1) * 8)
-#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
+#define ADDRESS_IS_ALIGNED_(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
#define UFS_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
CR (a, \
|