Refine the codes to compare the definition 'SIZE_4GB' with type
EFI_PHYSICAL_ADDRESS.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
//\r
Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This);\r
if ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) == 0 &&\r
- (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) {\r
+ (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) {\r
\r
//\r
// Bounce buffering is not possible for consistent mappings\r
// a bounce buffer and copy over the data in case HostAddress >= 4 GB.\r
//\r
Bounce = ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) == 0 &&\r
- (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB);\r
+ (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB);\r
\r
if (!Bounce) {\r
switch (Operation) {\r
Desc->AddrLen = Size;\r
Desc->AddrRangeMax = Base + Size - 1;\r
Desc->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;\r
- Desc->AddrSpaceGranularity = (Base + Size > SIZE_4GB) ? 64 : 32;\r
+ Desc->AddrSpaceGranularity = ((EFI_PHYSICAL_ADDRESS)Base + Size > SIZE_4GB) ? 64 : 32;\r
Desc->AddrTranslationOffset = 0;\r
}\r
VA_END (Args);\r