VirtualBox

Ignore:
Timestamp:
Nov 6, 2014 11:10:15 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96810
Message:

EFI: use rep ins/outs where appropriate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciRootBridgeIo.c

    r48674 r53251  
    995995  OutStride = mOutStride[Width];
    996996  OperationWidth = (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (Width & 0x03);
     997#ifdef VBOX
     998  /* rep ins/outs is much faster than single port I/O */
     999  if (Count > 1 && Width >= EfiPciWidthFifoUint8 && Width <= EfiPciWidthFifoUint32)
     1000  {
     1001    switch (Width)
     1002    {
     1003      case EfiPciWidthFifoUint8:
     1004        if (Write)
     1005          IoWriteBuffer8((UINTN)Address, Buffer, Count);
     1006        else
     1007          IoReadBuffer8((UINTN)Address, Buffer, Count);
     1008        break;
     1009      case EfiPciWidthFifoUint16:
     1010        if (Write)
     1011          IoWriteBuffer16((UINTN)Address, Buffer, Count);
     1012        else
     1013          IoReadBuffer16((UINTN)Address, Buffer, Count);
     1014        break;
     1015      case EfiPciWidthFifoUint32:
     1016        if (Write)
     1017          IoWriteBuffer32((UINTN)Address, Buffer, Count);
     1018        else
     1019          IoReadBuffer32((UINTN)Address, Buffer, Count);
     1020        break;
     1021      default:
     1022        ASSERT (FALSE);
     1023    }
     1024  } else {
     1025#endif
    9971026  for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
    9981027    if (Write) {
     
    10361065    }
    10371066  }
     1067#ifdef VBOX
     1068  }
     1069#endif
    10381070  return EFI_SUCCESS;
    10391071}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette