/* This routine can be used to start the root bridge. */
EFI_STATUS StartManagingRootBridge(IN PCI_IO_DEVICE *RootBridgeDev)
/* This routine can be used to start the root bridge. */
EFI_STATUS StartManagingRootBridge(IN PCI_IO_DEVICE *RootBridgeDev)
{
  EFI_HANDLE                       RootBridgeHandle;
  EFI_STATUS                       Status;
  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *PciRootBridgeIo;
  RootBridgeHandle = RootBridgeDev->Handle;
  PciRootBridgeIo  = NULL;
  Status = gBS->OpenProtocol (
                  RootBridgeHandle,
                  &gEfiPciRootBridgeIoProtocolGuid,
                  (VOID **)&PciRootBridgeIo,
                  gPciBusDriverBinding.DriverBindingHandle,
                  RootBridgeHandle,
                  EFI_OPEN_PROTOCOL_BY_DRIVER
                  );
  if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
    return Status;
  }
  RootBridgeDev->PciRootBridgeIo = PciRootBridgeIo;
  return EFI_SUCCESS;
}