x86_io.c File Reference

gPXE I/O API for x86 More...

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

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static uint64_t x86_readq (volatile uint64_t *io_addr)
 Read 64-bit qword from memory-mapped device.
static void x86_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, ioremap)
 PROVIDE_IOAPI_INLINE (x86, iounmap)
 PROVIDE_IOAPI_INLINE (x86, io_to_bus)
 PROVIDE_IOAPI_INLINE (x86, readb)
 PROVIDE_IOAPI_INLINE (x86, readw)
 PROVIDE_IOAPI_INLINE (x86, readl)
 PROVIDE_IOAPI (x86, readq, x86_readq)
 PROVIDE_IOAPI_INLINE (x86, writeb)
 PROVIDE_IOAPI_INLINE (x86, writew)
 PROVIDE_IOAPI_INLINE (x86, writel)
 PROVIDE_IOAPI (x86, writeq, x86_writeq)
 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)


Detailed Description

gPXE I/O API for x86

Definition in file x86_io.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static uint64_t x86_readq ( volatile uint64_t io_addr  )  [static]

Read 64-bit qword from memory-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read
This routine uses MMX instructions.

Definition at line 38 of file x86_io.c.

References __asm__().

00038                                                          {
00039         uint64_t data;
00040         __asm__ __volatile__ ( "pushl %%edx\n\t"
00041                                "pushl %%eax\n\t"
00042                                "movq (%1), %%mm0\n\t"
00043                                "movq %%mm0, (%%esp)\n\t"
00044                                "popl %%eax\n\t"
00045                                "popl %%edx\n\t"
00046                                "emms\n\t"
00047                                : "=A" ( data ) : "r" ( io_addr ) );
00048         return data;
00049 }

static void x86_writeq ( uint64_t  data,
volatile uint64_t io_addr 
) [static]

Write 64-bit qword to memory-mapped device.

Parameters:
data Value to write
io_addr I/O address
This routine uses MMX instructions.

Definition at line 59 of file x86_io.c.

References __asm__().

00059                                                                      {
00060         __asm__ __volatile__ ( "pushl %%edx\n\t"
00061                                "pushl %%eax\n\t"
00062                                "movq (%%esp), %%mm0\n\t"
00063                                "movq %%mm0, (%1)\n\t"
00064                                "popl %%eax\n\t"
00065                                "popl %%edx\n\t"
00066                                "emms\n\t"
00067                                : : "A" ( data ), "r" ( io_addr ) );
00068 }

PROVIDE_IOAPI_INLINE ( x86  ,
phys_to_bus   
)

PROVIDE_IOAPI_INLINE ( x86  ,
bus_to_phys   
)

PROVIDE_IOAPI_INLINE ( x86  ,
ioremap   
)

PROVIDE_IOAPI_INLINE ( x86  ,
iounmap   
)

PROVIDE_IOAPI_INLINE ( x86  ,
io_to_bus   
)

PROVIDE_IOAPI_INLINE ( x86  ,
readb   
)

PROVIDE_IOAPI_INLINE ( x86  ,
readw   
)

PROVIDE_IOAPI_INLINE ( x86  ,
readl   
)

PROVIDE_IOAPI ( x86  ,
readq  ,
x86_readq   
)

PROVIDE_IOAPI_INLINE ( x86  ,
writeb   
)

PROVIDE_IOAPI_INLINE ( x86  ,
writew   
)

PROVIDE_IOAPI_INLINE ( x86  ,
writel   
)

PROVIDE_IOAPI ( x86  ,
writeq  ,
x86_writeq   
)

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   
)


Generated on Tue Apr 6 20:01:12 2010 for gPXE by  doxygen 1.5.7.1