/* This routine gets translation offset from a root bridge instance by resource type. */
UINT64 GetTranslationByResourceType(IN PCI_ROOT_BRIDGE_INSTANCE *RootBridge, IN PCI_RESOURCE_TYPE ResourceType)
/* This routine gets translation offset from a root bridge instance by resource type. */
UINT64 GetTranslationByResourceType(IN PCI_ROOT_BRIDGE_INSTANCE *RootBridge, IN PCI_RESOURCE_TYPE ResourceType)
{
  switch (ResourceType) {
    case TypeIo:
      return RootBridge->Io.Translation;
    case TypeMem32:
      return RootBridge->Mem.Translation;
    case TypePMem32:
      return RootBridge->PMem.Translation;
    case TypeMem64:
      return RootBridge->MemAbove4G.Translation;
    case TypePMem64:
      return RootBridge->PMemAbove4G.Translation;
    case TypeBus:
      return RootBridge->Bus.Translation;
    default:
      ASSERT (FALSE);
      return 0;
  }
}