Changeset 58498 in vbox for trunk/src/VBox/Devices/EFI/Firmware
- Timestamp:
- Oct 29, 2015 7:27:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciRootBridgeIo.c
r58466 r58498 15 15 #include "PciHostBridge.h" 16 16 #include "IoFifo.h" 17 #ifdef VBOX18 # define IN_RING319 # include <iprt/asm-amd64-x86.h>20 #endif21 17 22 18 typedef struct { … … 1000 996 OutStride = mOutStride[Width]; 1001 997 OperationWidth = (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (Width & 0x03); 1002 #ifdef VBOX 1003 /* rep ins/outs is much faster than single port I/O */ 1004 if (Count > 1 && Width >= EfiPciWidthFifoUint8 && Width <= EfiPciWidthFifoUint32) 1005 { 1006 switch (Width) 1007 { 1008 case EfiPciWidthFifoUint8: 1009 if (Write) 1010 ASMOutStrU8((RTIOPORT)Address, (const uint8_t*)Buffer, (size_t)Count); 1011 else 1012 ASMInStrU8((RTIOPORT)Address, (uint8_t*)Buffer, (size_t)Count); 1013 break; 1014 case EfiPciWidthFifoUint16: 1015 if (Write) 1016 ASMOutStrU16((RTIOPORT)Address, (const uint16_t*)Buffer, (size_t)Count); 1017 else 1018 ASMInStrU16((RTIOPORT)Address, (uint16_t*)Buffer, (size_t)Count); 1019 break; 1020 case EfiPciWidthFifoUint32: 1021 if (Write) 1022 ASMOutStrU32((RTIOPORT)Address, (const uint32_t*)Buffer, (size_t)Count); 1023 else 1024 ASMInStrU32((RTIOPORT)Address, (uint32_t*)Buffer, (size_t)Count); 1025 break; 1026 default: 1027 ASSERT (FALSE); 1028 } 1029 } else { 1030 #endif 1031 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { 998 999 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64) 1000 if (InStride == 0) { 1032 1001 if (Write) { 1033 1002 switch (OperationWidth) { 1034 1003 case EfiPciWidthUint8: 1035 IoWrite 8 ((UINTN)Address, *Uint8Buffer);1036 break;1004 IoWriteFifo8 ((UINTN) Address, Count, Buffer); 1005 return EFI_SUCCESS; 1037 1006 case EfiPciWidthUint16: 1038 IoWrite 16 ((UINTN)Address, *((UINT16 *)Uint8Buffer));1039 break;1007 IoWriteFifo16 ((UINTN) Address, Count, Buffer); 1008 return EFI_SUCCESS; 1040 1009 case EfiPciWidthUint32: 1041 IoWrite 32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));1042 break;1010 IoWriteFifo32 ((UINTN) Address, Count, Buffer); 1011 return EFI_SUCCESS; 1043 1012 default: 1044 1013 // … … 1052 1021 switch (OperationWidth) { 1053 1022 case EfiPciWidthUint8: 1054 *Uint8Buffer = IoRead8 ((UINTN)Address);1055 break;1023 IoReadFifo8 ((UINTN) Address, Count, Buffer); 1024 return EFI_SUCCESS; 1056 1025 case EfiPciWidthUint16: 1057 *((UINT16 *)Uint8Buffer) = IoRead16 ((UINTN)Address);1058 break;1026 IoReadFifo16 ((UINTN) Address, Count, Buffer); 1027 return EFI_SUCCESS; 1059 1028 case EfiPciWidthUint32: 1060 *((UINT32 *)Uint8Buffer) = IoRead32 ((UINTN)Address);1061 break;1029 IoReadFifo32 ((UINTN) Address, Count, Buffer); 1030 return EFI_SUCCESS; 1062 1031 default: 1063 1032 // … … 1070 1039 } 1071 1040 } 1072 #ifdef VBOX1073 }1074 1041 #endif 1042 1043 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { 1044 if (Write) { 1045 switch (OperationWidth) { 1046 case EfiPciWidthUint8: 1047 IoWrite8 ((UINTN)Address, *Uint8Buffer); 1048 break; 1049 case EfiPciWidthUint16: 1050 IoWrite16 ((UINTN)Address, *((UINT16 *)Uint8Buffer)); 1051 break; 1052 case EfiPciWidthUint32: 1053 IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer)); 1054 break; 1055 default: 1056 // 1057 // The RootBridgeIoCheckParameter call above will ensure that this 1058 // path is not taken. 1059 // 1060 ASSERT (FALSE); 1061 break; 1062 } 1063 } else { 1064 switch (OperationWidth) { 1065 case EfiPciWidthUint8: 1066 *Uint8Buffer = IoRead8 ((UINTN)Address); 1067 break; 1068 case EfiPciWidthUint16: 1069 *((UINT16 *)Uint8Buffer) = IoRead16 ((UINTN)Address); 1070 break; 1071 case EfiPciWidthUint32: 1072 *((UINT32 *)Uint8Buffer) = IoRead32 ((UINTN)Address); 1073 break; 1074 default: 1075 // 1076 // The RootBridgeIoCheckParameter call above will ensure that this 1077 // path is not taken. 1078 // 1079 ASSERT (FALSE); 1080 break; 1081 } 1082 } 1083 } 1084 1075 1085 return EFI_SUCCESS; 1076 1086 }
Note:
See TracChangeset
for help on using the changeset viewer.