mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address type
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>
This commit is contained in:
parent
ce5354d68c
commit
b494cf96e7
|
@ -598,7 +598,7 @@ CoherentPciIoMap (
|
|||
//
|
||||
Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This);
|
||||
if ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) == 0 &&
|
||||
(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) {
|
||||
(EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) {
|
||||
|
||||
//
|
||||
// Bounce buffering is not possible for consistent mappings
|
||||
|
@ -1006,7 +1006,7 @@ NonCoherentPciIoMap (
|
|||
// a bounce buffer and copy over the data in case HostAddress >= 4 GB.
|
||||
//
|
||||
Bounce = ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) == 0 &&
|
||||
(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB);
|
||||
(EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > SIZE_4GB);
|
||||
|
||||
if (!Bounce) {
|
||||
switch (Operation) {
|
||||
|
|
|
@ -163,7 +163,7 @@ RegisterNonDiscoverableMmioDevice (
|
|||
Desc->AddrLen = Size;
|
||||
Desc->AddrRangeMax = Base + Size - 1;
|
||||
Desc->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
|
||||
Desc->AddrSpaceGranularity = (Base + Size > SIZE_4GB) ? 64 : 32;
|
||||
Desc->AddrSpaceGranularity = ((EFI_PHYSICAL_ADDRESS)Base + Size > SIZE_4GB) ? 64 : 32;
|
||||
Desc->AddrTranslationOffset = 0;
|
||||
}
|
||||
VA_END (Args);
|
||||
|
|
Loading…
Reference in New Issue