VirtualBox

Ignore:
Timestamp:
Nov 6, 2014 12:57:32 PM (10 years ago)
Author:
vboxsync
Message:

EFI: don't define ins/outs functions but use <iprt/asm-amd64-x86.h> instead to keep it compiable on Windows

Location:
trunk/src/VBox/Devices/EFI/Firmware/MdePkg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Library/IoLib.h

    r53251 r53252  
    26202620
    26212621
    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 
    27222622#endif
    27232623
  • trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c

    r53251 r53252  
    197197}
    198198
    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 */
Note: See TracChangeset for help on using the changeset viewer.

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