Changeset 53251 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 6, 2014 11:10:15 AM (10 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Library/IoLib.h
r48674 r53251 2620 2620 2621 2621 2622 #ifdef VBOX 2623 2624 /** 2625 Reads an 8-bit I/O FIFO port. 2626 2627 @param Port The I/O port to read. 2628 @param Buffer The buffer to write the data to. 2629 @param Count The number of bytes to read. 2630 2631 **/ 2632 VOID 2633 EFIAPI 2634 IoReadBuffer8 ( 2635 IN UINTN Port, 2636 OUT VOID *Buffer, 2637 IN UINTN Count 2638 ); 2639 2640 /** 2641 Reads a 16-bit I/O FIFO port. 2642 2643 @param Port The I/O port to read. 2644 @param Buffer The buffer to write the data to. 2645 @param Count The number of words to read. 2646 2647 **/ 2648 VOID 2649 EFIAPI 2650 IoReadBuffer16 ( 2651 IN UINTN Port, 2652 OUT VOID *Buffer, 2653 IN UINTN Count 2654 ); 2655 2656 /** 2657 Reads a 32-bit I/O FIFO port. 2658 2659 @param Port The I/O port to read. 2660 @param Buffer The buffer to write the data to. 2661 @param Count The number of dwords to read. 2662 2663 **/ 2664 VOID 2665 EFIAPI 2666 IoReadBuffer32 ( 2667 IN UINTN Port, 2668 OUT VOID *Buffer, 2669 IN UINTN Count 2670 ); 2671 2672 /** 2673 Writes to an 8-bit I/O FIFO port. 2674 2675 @param Port The I/O port to read. 2676 @param Buffer The buffer to write the data to. 2677 @param Count The number of bytes to write. 2678 2679 **/ 2680 VOID 2681 EFIAPI 2682 IoWriteBuffer8 ( 2683 IN UINTN Port, 2684 IN CONST VOID *Buffer, 2685 IN UINTN Count 2686 ); 2687 2688 /** 2689 Writes to a 16-bit I/O FIFO port. 2690 2691 @param Port The I/O port to read. 2692 @param Buffer The buffer to write the data to. 2693 @param Count The number of words to write. 2694 2695 **/ 2696 VOID 2697 EFIAPI 2698 IoWriteBuffer16 ( 2699 IN UINTN Port, 2700 IN CONST VOID *Buffer, 2701 IN UINTN Count 2702 ); 2703 2704 /** 2705 Writes to a 32-bit I/O FIFO port. 2706 2707 @param Port The I/O port to read. 2708 @param Buffer The buffer to write the data to. 2709 @param Count The number of dwords to write. 2710 2711 **/ 2712 VOID 2713 EFIAPI 2714 IoWriteBuffer32 ( 2715 IN UINTN Port, 2716 IN CONST VOID *Buffer, 2717 IN UINTN Count 2718 ); 2719 2720 #endif /* VBOX */ 2721 2622 2722 #endif 2623 2723 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
r48674 r53251 197 197 } 198 198 199 200 #ifdef VBOX 201 202 /** 203 Reads an 8-bit I/O FIFO port. 204 205 @param Port The I/O port to read. 206 @param Buffer The buffer to write the data to. 207 @param Count The number of bytes to read. 208 209 **/ 210 __inline__ 211 VOID 212 EFIAPI 213 IoReadBuffer8 ( 214 IN UINTN Port, 215 OUT VOID *Buffer, 216 IN UINTN Count 217 ) 218 { 219 __asm__ __volatile__ ("rep; insb" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 220 } 221 222 223 /** 224 Reads a 16-bit I/O FIFO port. 225 226 @param Port The I/O port to read. 227 @param Buffer The buffer to write the data to. 228 @param Count The number of words to read. 229 230 **/ 231 __inline__ 232 VOID 233 EFIAPI 234 IoReadBuffer16 ( 235 IN UINTN Port, 236 OUT VOID *Buffer, 237 IN UINTN Count 238 ) 239 { 240 __asm__ __volatile__ ("rep; insw" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 241 } 242 243 /** 244 Reads a 32-bit I/O FIFO port. 245 246 @param Port The I/O port to read. 247 @param Buffer The buffer to write the data to. 248 @param Count The number of dwords to read. 249 250 **/ 251 __inline__ 252 VOID 253 EFIAPI 254 IoReadBuffer32 ( 255 IN UINTN Port, 256 OUT VOID *Buffer, 257 IN UINTN Count 258 ) 259 { 260 __asm__ __volatile__ ("rep; insl" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 261 } 262 263 264 /** 265 Writes to an 8-bit I/O FIFO port. 266 267 @param Port The I/O port to read. 268 @param Buffer The buffer to write the data to. 269 @param Count The number of bytes to write. 270 271 **/ 272 __inline__ 273 VOID 274 EFIAPI 275 IoWriteBuffer8 ( 276 IN UINTN Port, 277 IN CONST VOID *Buffer, 278 IN UINTN Count 279 ) 280 { 281 __asm__ __volatile__ ("rep; outsb" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 282 } 283 284 285 /** 286 Writes to a 16-bit I/O FIFO port. 287 288 @param Port The I/O port to read. 289 @param Buffer The buffer to write the data to. 290 @param Count The number of words to write. 291 292 **/ 293 __inline__ 294 VOID 295 EFIAPI 296 IoWriteBuffer16 ( 297 IN UINTN Port, 298 IN CONST VOID *Buffer, 299 IN UINTN Count 300 ) 301 { 302 __asm__ __volatile__ ("rep; outsw" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 303 } 304 305 /** 306 Writes to a 32-bit I/O FIFO port. 307 308 @param Port The I/O port to read. 309 @param Buffer The buffer to write the data to. 310 @param Count The number of dwords to write. 311 312 **/ 313 __inline__ 314 VOID 315 EFIAPI 316 IoWriteBuffer32 ( 317 IN UINTN Port, 318 IN CONST VOID *Buffer, 319 IN UINTN Count 320 ) 321 { 322 __asm__ __volatile__ ("rep; outsl" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 323 } 324 325 #endif /* VBOX */ -
trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciRootBridgeIo.c
r48674 r53251 995 995 OutStride = mOutStride[Width]; 996 996 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 997 1026 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { 998 1027 if (Write) { … … 1036 1065 } 1037 1066 } 1067 #ifdef VBOX 1068 } 1069 #endif 1038 1070 return EFI_SUCCESS; 1039 1071 }
Note:
See TracChangeset
for help on using the changeset viewer.