|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 05/18] OvmfPkg/XenbusDxe: Open PciIo protocol.
On Wed, Jul 16, 2014 at 01:39:36PM -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Jul 16, 2014 at 04:15:34PM +0100, Anthony PERARD wrote:
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>
> Could you describe a bit why you need to use it?
>
> I think I know why - that is you need to poke at its IO ports
> but it would be good to mention that in here.
I thinks it's need to be open so that, OVMF will not be able to start
the drivers a second time (OpenProtocol would return ALREADY_STARTED or
something equivalent).
So far I did not do anything with the IO ports, I probably should. But I
don't think it will be needed to explain that before it's actually done.
> > ---
> > OvmfPkg/XenbusDxe/XenbusDxe.c | 16 ++++++++++++++++
> > OvmfPkg/XenbusDxe/XenbusDxe.h | 1 +
> > 2 files changed, 17 insertions(+)
> >
> > diff --git a/OvmfPkg/XenbusDxe/XenbusDxe.c b/OvmfPkg/XenbusDxe/XenbusDxe.c
> > index 63ea31b..ba5e8f4 100644
> > --- a/OvmfPkg/XenbusDxe/XenbusDxe.c
> > +++ b/OvmfPkg/XenbusDxe/XenbusDxe.c
> > @@ -290,11 +290,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;
> >
> > Status = XenHyperpageInit (Dev);
> > ASSERT_EFI_ERROR (Status);
> > @@ -351,5 +365,7 @@ XenbusDxeDriverBindingStop (
> >
> > gBS->CloseEvent (Dev->ExitBootEvent);
> >
> > + gBS->CloseProtocol(ControllerHandle, &gEfiPciIoProtocolGuid,
> > + This->DriverBindingHandle, ControllerHandle);
> > return EFI_SUCCESS;
> > }
> > diff --git a/OvmfPkg/XenbusDxe/XenbusDxe.h b/OvmfPkg/XenbusDxe/XenbusDxe.h
> > index 6140f94..d57e3c8 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;
> > --
> > Anthony PERARD
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxx
> > http://lists.xen.org/xen-devel
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |