summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-09-25 10:58:56 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-09-26 12:12:53 +0800
commit69b40465048e4289854d881e90007811c09d42d8 (patch)
tree8adfa8a17ef8679b7246b8697618ce7cde196347 /MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
parentb8bfb92b4e24cbd639e896bc0a4f8cc0e168b9ae (diff)
downloadedk2-69b40465048e4289854d881e90007811c09d42d8.zip
edk2-69b40465048e4289854d881e90007811c09d42d8.tar.gz
edk2-69b40465048e4289854d881e90007811c09d42d8.tar.bz2
MdeModulePkg/PciHostBridge: Move declaration of mIoMmu to header file
The change doesn't have functionality impact. It just renames the mIoMmuProtocol to mIoMmu and moves the declaration from PciRootBridgeIo.c to PciHostBridge.h. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Suggested-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c')
-rw-r--r--MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
index 16413b6..4c908fa 100644
--- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
+++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
@@ -17,8 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "PciRootBridge.h"
#include "PciHostResource.h"
-extern EDKII_IOMMU_PROTOCOL *mIoMmuProtocol;
-
#define NO_MAPPING (VOID *) (UINTN) -1
#define RESOURCE_VALID(Resource) ((Resource)->Base <= (Resource)->Limit)
@@ -1269,7 +1267,7 @@ RootBridgeIoMap (
RootBridge = ROOT_BRIDGE_FROM_THIS (This);
- if (mIoMmuProtocol != NULL) {
+ if (mIoMmu != NULL) {
if (!RootBridge->DmaAbove4G) {
//
// Clear 64bit support
@@ -1278,14 +1276,14 @@ RootBridgeIoMap (
Operation = (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION) (Operation - EfiPciOperationBusMasterRead64);
}
}
- Status = mIoMmuProtocol->Map (
- mIoMmuProtocol,
- (EDKII_IOMMU_OPERATION) Operation,
- HostAddress,
- NumberOfBytes,
- DeviceAddress,
- Mapping
- );
+ Status = mIoMmu->Map (
+ mIoMmu,
+ (EDKII_IOMMU_OPERATION) Operation,
+ HostAddress,
+ NumberOfBytes,
+ DeviceAddress,
+ Mapping
+ );
return Status;
}
@@ -1413,11 +1411,11 @@ RootBridgeIoUnmap (
PCI_ROOT_BRIDGE_INSTANCE *RootBridge;
EFI_STATUS Status;
- if (mIoMmuProtocol != NULL) {
- Status = mIoMmuProtocol->Unmap (
- mIoMmuProtocol,
- Mapping
- );
+ if (mIoMmu != NULL) {
+ Status = mIoMmu->Unmap (
+ mIoMmu,
+ Mapping
+ );
return Status;
}
@@ -1539,21 +1537,21 @@ RootBridgeIoAllocateBuffer (
RootBridge = ROOT_BRIDGE_FROM_THIS (This);
- if (mIoMmuProtocol != NULL) {
+ if (mIoMmu != NULL) {
if (!RootBridge->DmaAbove4G) {
//
// Clear DUAL_ADDRESS_CYCLE
//
Attributes &= ~((UINT64) EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE);
}
- Status = mIoMmuProtocol->AllocateBuffer (
- mIoMmuProtocol,
- Type,
- MemoryType,
- Pages,
- HostAddress,
- Attributes
- );
+ Status = mIoMmu->AllocateBuffer (
+ mIoMmu,
+ Type,
+ MemoryType,
+ Pages,
+ HostAddress,
+ Attributes
+ );
return Status;
}
@@ -1603,12 +1601,12 @@ RootBridgeIoFreeBuffer (
{
EFI_STATUS Status;
- if (mIoMmuProtocol != NULL) {
- Status = mIoMmuProtocol->FreeBuffer (
- mIoMmuProtocol,
- Pages,
- HostAddress
- );
+ if (mIoMmu != NULL) {
+ Status = mIoMmu->FreeBuffer (
+ mIoMmu,
+ Pages,
+ HostAddress
+ );
return Status;
}