diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2014-10-29 06:49:22 +0000 |
---|---|---|
committer | jljusten <jljusten@Edk2> | 2014-10-29 06:49:22 +0000 |
commit | 956622c4c9b25becf57ccc1771ffbc92b78ed005 (patch) | |
tree | ae72380a6373d9e7b10e8e9f1e39fcfb52c9bcfd /OvmfPkg | |
parent | abcbbb14a44a83b4cdf90137307a62e7b58e6720 (diff) | |
download | edk2-platforms-956622c4c9b25becf57ccc1771ffbc92b78ed005.tar.xz |
OvmfPkg/XenBusDxe: Open PciIo protocol.
The PciIo interface will be used in "OvmfPkg/XenBusDxe: Add Grant Table
functions" to get the memory address of the BAR 1 and use the space to
map shared memory.
Change in V3:
- add a commit description.
Change in V2:
- Coding style
- Error handler
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16261 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/XenBusDxe/XenBusDxe.c | 19 | ||||
-rw-r--r-- | OvmfPkg/XenBusDxe/XenBusDxe.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c index 4c638b85f1..776d896368 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.c +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c @@ -281,11 +281,25 @@ XenBusDxeDriverBindingStart ( {
EFI_STATUS Status;
XENBUS_DEVICE *Dev;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo,
+ This->DriverBindingHandle,
+ ControllerHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
Dev = AllocateZeroPool (sizeof (*Dev));
Dev->Signature = XENBUS_DEVICE_SIGNATURE;
Dev->This = This;
Dev->ControllerHandle = ControllerHandle;
+ Dev->PciIo = PciIo;
EfiAcquireLock (&mMyDeviceLock);
if (mMyDevice != NULL) {
@@ -323,6 +337,8 @@ XenBusDxeDriverBindingStart ( ErrorAllocated:
FreePool (Dev);
+ gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle, ControllerHandle);
return Status;
}
@@ -365,6 +381,9 @@ XenBusDxeDriverBindingStop ( gBS->CloseEvent (Dev->ExitBootEvent);
+ gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle, ControllerHandle);
+
mMyDevice = NULL;
FreePool (Dev);
return EFI_SUCCESS;
diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.h b/OvmfPkg/XenBusDxe/XenBusDxe.h index ccec0ce0e5..388d299695 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.h +++ b/OvmfPkg/XenBusDxe/XenBusDxe.h @@ -84,6 +84,7 @@ struct _XENBUS_DEVICE { UINT32 Signature;
EFI_DRIVER_BINDING_PROTOCOL *This;
EFI_HANDLE ControllerHandle;
+ EFI_PCI_IO_PROTOCOL *PciIo;
EFI_EVENT ExitBootEvent;
VOID *Hyperpage;
|