iPXE
Functions
x86_io.c File Reference

iPXE I/O API for x86 More...

#include <ipxe/io.h>
#include <ipxe/x86_io.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static __unused uint64_t i386_readq (volatile uint64_t *io_addr)
 Read 64-bit qword from memory-mapped device.
static __unused void i386_writeq (uint64_t data, volatile uint64_t *io_addr)
 Write 64-bit qword to memory-mapped device.
 PROVIDE_IOAPI_INLINE (x86, phys_to_bus)
 PROVIDE_IOAPI_INLINE (x86, bus_to_phys)
 PROVIDE_IOAPI_INLINE (x86, readb)
 PROVIDE_IOAPI_INLINE (x86, readw)
 PROVIDE_IOAPI_INLINE (x86, readl)
 PROVIDE_IOAPI_INLINE (x86, writeb)
 PROVIDE_IOAPI_INLINE (x86, writew)
 PROVIDE_IOAPI_INLINE (x86, writel)
 PROVIDE_IOAPI_INLINE (x86, inb)
 PROVIDE_IOAPI_INLINE (x86, inw)
 PROVIDE_IOAPI_INLINE (x86, inl)
 PROVIDE_IOAPI_INLINE (x86, outb)
 PROVIDE_IOAPI_INLINE (x86, outw)
 PROVIDE_IOAPI_INLINE (x86, outl)
 PROVIDE_IOAPI_INLINE (x86, insb)
 PROVIDE_IOAPI_INLINE (x86, insw)
 PROVIDE_IOAPI_INLINE (x86, insl)
 PROVIDE_IOAPI_INLINE (x86, outsb)
 PROVIDE_IOAPI_INLINE (x86, outsw)
 PROVIDE_IOAPI_INLINE (x86, outsl)
 PROVIDE_IOAPI_INLINE (x86, iodelay)
 PROVIDE_IOAPI_INLINE (x86, mb)
 PROVIDE_IOAPI (x86, readq, i386_readq)
 PROVIDE_IOAPI (x86, writeq, i386_writeq)

Detailed Description

iPXE I/O API for x86

Definition in file x86_io.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static __unused uint64_t i386_readq ( volatile uint64_t io_addr) [static]

Read 64-bit qword from memory-mapped device.

Parameters:
io_addrI/O address
Return values:
dataValue read

This routine uses MMX instructions.

Definition at line 43 of file x86_io.c.

References __asm__(), and data.

                                                                   {
        uint64_t data;
        __asm__ __volatile__ ( "pushl %%edx\n\t"
                               "pushl %%eax\n\t"
                               "movq (%1), %%mm0\n\t"
                               "movq %%mm0, (%%esp)\n\t"
                               "popl %%eax\n\t"
                               "popl %%edx\n\t"
                               "emms\n\t"
                               : "=A" ( data ) : "r" ( io_addr ) );
        return data;
}
static __unused void i386_writeq ( uint64_t  data,
volatile uint64_t io_addr 
) [static]

Write 64-bit qword to memory-mapped device.

Parameters:
dataValue to write
io_addrI/O address

This routine uses MMX instructions.

Definition at line 64 of file x86_io.c.

References __asm__().

                                                                               {
        __asm__ __volatile__ ( "pushl %%edx\n\t"
                               "pushl %%eax\n\t"
                               "movq (%%esp), %%mm0\n\t"
                               "movq %%mm0, (%1)\n\t"
                               "popl %%eax\n\t"
                               "popl %%edx\n\t"
                               "emms\n\t"
                               : : "A" ( data ), "r" ( io_addr ) );
}
PROVIDE_IOAPI_INLINE ( x86  ,
readb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
readw   
)
PROVIDE_IOAPI_INLINE ( x86  ,
readl   
)
PROVIDE_IOAPI_INLINE ( x86  ,
writeb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
writew   
)
PROVIDE_IOAPI_INLINE ( x86  ,
writel   
)
PROVIDE_IOAPI_INLINE ( x86  ,
inb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
inw   
)
PROVIDE_IOAPI_INLINE ( x86  ,
inl   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outw   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outl   
)
PROVIDE_IOAPI_INLINE ( x86  ,
insb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
insw   
)
PROVIDE_IOAPI_INLINE ( x86  ,
insl   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outsb   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outsw   
)
PROVIDE_IOAPI_INLINE ( x86  ,
outsl   
)
PROVIDE_IOAPI_INLINE ( x86  ,
iodelay   
)
PROVIDE_IOAPI_INLINE ( x86  ,
mb   
)
PROVIDE_IOAPI ( x86  ,
readq  ,
i386_readq   
)
PROVIDE_IOAPI ( x86  ,
writeq  ,
i386_writeq   
)