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. More...
 
static __unused void i386_writeq (uint64_t data, volatile uint64_t *io_addr)
 Write 64-bit qword to memory-mapped device. More...
 
 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()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ i386_readq()

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.

43  {
44  uint64_t data;
45  __asm__ __volatile__ ( "pushl %%edx\n\t"
46  "pushl %%eax\n\t"
47  "movq (%1), %%mm0\n\t"
48  "movq %%mm0, (%%esp)\n\t"
49  "popl %%eax\n\t"
50  "popl %%edx\n\t"
51  "emms\n\t"
52  : "=A" ( data ) : "r" ( io_addr ) );
53  return data;
54 }
unsigned long long uint64_t
Definition: stdint.h:13
__asm__ __volatile__("\n1:\n\t" "movb -1(%2,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %3, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12

References __asm__(), __volatile__(), and data.

◆ i386_writeq()

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.

64  {
65  __asm__ __volatile__ ( "pushl %%edx\n\t"
66  "pushl %%eax\n\t"
67  "movq (%%esp), %%mm0\n\t"
68  "movq %%mm0, (%1)\n\t"
69  "popl %%eax\n\t"
70  "popl %%edx\n\t"
71  "emms\n\t"
72  : : "A" ( data ), "r" ( io_addr ) );
73 }
__asm__ __volatile__("\n1:\n\t" "movb -1(%2,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %3, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12

References __asm__(), __volatile__(), and data.

◆ PROVIDE_IOAPI_INLINE() [1/22]

PROVIDE_IOAPI_INLINE ( x86  ,
phys_to_bus   
)

◆ PROVIDE_IOAPI_INLINE() [2/22]

PROVIDE_IOAPI_INLINE ( x86  ,
bus_to_phys   
)

◆ PROVIDE_IOAPI_INLINE() [3/22]

PROVIDE_IOAPI_INLINE ( x86  ,
readb   
)

◆ PROVIDE_IOAPI_INLINE() [4/22]

PROVIDE_IOAPI_INLINE ( x86  ,
readw   
)

◆ PROVIDE_IOAPI_INLINE() [5/22]

PROVIDE_IOAPI_INLINE ( x86  ,
readl   
)

◆ PROVIDE_IOAPI_INLINE() [6/22]

PROVIDE_IOAPI_INLINE ( x86  ,
writeb   
)

◆ PROVIDE_IOAPI_INLINE() [7/22]

PROVIDE_IOAPI_INLINE ( x86  ,
writew   
)

◆ PROVIDE_IOAPI_INLINE() [8/22]

PROVIDE_IOAPI_INLINE ( x86  ,
writel   
)

◆ PROVIDE_IOAPI_INLINE() [9/22]

PROVIDE_IOAPI_INLINE ( x86  ,
inb   
)

◆ PROVIDE_IOAPI_INLINE() [10/22]

PROVIDE_IOAPI_INLINE ( x86  ,
inw   
)

◆ PROVIDE_IOAPI_INLINE() [11/22]

PROVIDE_IOAPI_INLINE ( x86  ,
inl   
)

◆ PROVIDE_IOAPI_INLINE() [12/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outb   
)

◆ PROVIDE_IOAPI_INLINE() [13/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outw   
)

◆ PROVIDE_IOAPI_INLINE() [14/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outl   
)

◆ PROVIDE_IOAPI_INLINE() [15/22]

PROVIDE_IOAPI_INLINE ( x86  ,
insb   
)

◆ PROVIDE_IOAPI_INLINE() [16/22]

PROVIDE_IOAPI_INLINE ( x86  ,
insw   
)

◆ PROVIDE_IOAPI_INLINE() [17/22]

PROVIDE_IOAPI_INLINE ( x86  ,
insl   
)

◆ PROVIDE_IOAPI_INLINE() [18/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outsb   
)

◆ PROVIDE_IOAPI_INLINE() [19/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outsw   
)

◆ PROVIDE_IOAPI_INLINE() [20/22]

PROVIDE_IOAPI_INLINE ( x86  ,
outsl   
)

◆ PROVIDE_IOAPI_INLINE() [21/22]

PROVIDE_IOAPI_INLINE ( x86  ,
iodelay   
)

◆ PROVIDE_IOAPI_INLINE() [22/22]

PROVIDE_IOAPI_INLINE ( x86  ,
mb   
)

◆ PROVIDE_IOAPI() [1/2]

PROVIDE_IOAPI ( x86  ,
readq  ,
i386_readq   
)

◆ PROVIDE_IOAPI() [2/2]

PROVIDE_IOAPI ( x86  ,
writeq  ,
i386_writeq   
)