iPXE
Data Structures | Defines | Functions
io.h File Reference

iPXE I/O API More...

#include <stdint.h>
#include <ipxe/api.h>
#include <ipxe/iomap.h>
#include <config/ioapi.h>
#include <bits/io.h>

Go to the source code of this file.

Data Structures

struct  memory_region
 A usable memory region. More...
struct  memory_map
 A memory map. More...

Defines

#define PAGE_SIZE   ( 1 << PAGE_SHIFT )
 Page size.
#define PAGE_MASK   ( PAGE_SIZE - 1 )
 Page mask.
#define IOAPI_INLINE(_subsys, _api_func)   SINGLE_API_INLINE ( IOAPI_PREFIX_ ## _subsys, _api_func )
 Calculate static inline I/O API function name.
#define PROVIDE_IOAPI(_subsys, _api_func, _func)   PROVIDE_SINGLE_API ( IOAPI_PREFIX_ ## _subsys, _api_func, _func )
 Provide an I/O API implementation.
#define PROVIDE_IOAPI_INLINE(_subsys, _api_func)   PROVIDE_SINGLE_API_INLINE ( IOAPI_PREFIX_ ## _subsys, _api_func )
 Provide a static inline I/O API implementation.
#define IOAPI_READ(_func, _type, io_addr, _prefix, _ndigits)
 Wrap an I/O read.
#define IOAPI_WRITE(_func, _type, data, io_addr, _prefix, _ndigits)
 Wrap an I/O write.
#define IOAPI_READS(_func, _type, io_addr, data, count, _prefix, _ndigits)
 Wrap an I/O string read.
#define IOAPI_WRITES(_func, _type, io_addr, data, count, _prefix, _ndigits)
 Wrap an I/O string write.
#define readb(io_addr)   IOAPI_READ ( readb, uint8_t, io_addr, "MEM", 2 )
#define readw(io_addr)   IOAPI_READ ( readw, uint16_t, io_addr, "MEM", 4 )
#define readl(io_addr)   IOAPI_READ ( readl, uint32_t, io_addr, "MEM", 8 )
#define readq(io_addr)   IOAPI_READ ( readq, uint64_t, io_addr, "MEM", 16 )
#define writeb(data, io_addr)   IOAPI_WRITE ( writeb, uint8_t, data, io_addr, "MEM", 2 )
#define writew(data, io_addr)   IOAPI_WRITE ( writew, uint16_t, data, io_addr, "MEM", 4 )
#define writel(data, io_addr)   IOAPI_WRITE ( writel, uint32_t, data, io_addr, "MEM", 8 )
#define writeq(data, io_addr)   IOAPI_WRITE ( writeq, uint64_t, data, io_addr, "MEM", 16 )
#define inb(io_addr)   IOAPI_READ ( inb, uint8_t, io_addr, "IO", 2 )
#define inw(io_addr)   IOAPI_READ ( inw, uint16_t, io_addr, "IO", 4 )
#define inl(io_addr)   IOAPI_READ ( inl, uint32_t, io_addr, "IO", 8 )
#define outb(data, io_addr)   IOAPI_WRITE ( outb, uint8_t, data, io_addr, "IO", 2 )
#define outw(data, io_addr)   IOAPI_WRITE ( outw, uint16_t, data, io_addr, "IO", 4 )
#define outl(data, io_addr)   IOAPI_WRITE ( outl, uint32_t, data, io_addr, "IO", 8 )
#define insb(io_addr, data, count)   IOAPI_READS ( insb, uint8_t, io_addr, data, count, "IO", 2 )
#define insw(io_addr, data, count)   IOAPI_READS ( insw, uint16_t, io_addr, data, count, "IO", 4 )
#define insl(io_addr, data, count)   IOAPI_READS ( insl, uint32_t, io_addr, data, count, "IO", 8 )
#define outsb(io_addr, data, count)   IOAPI_WRITES ( outsb, uint8_t, io_addr, data, count, "IO", 2 )
#define outsw(io_addr, data, count)   IOAPI_WRITES ( outsw, uint16_t, io_addr, data, count, "IO", 4 )
#define outsl(io_addr, data, count)   IOAPI_WRITES ( outsl, uint32_t, io_addr, data, count, "IO", 8 )
#define INX_P(_func, _type, io_addr)
 Read value from I/O-mapped device, slowly.
#define inb_p(io_addr)   INX_P ( inb, uint8_t, io_addr )
 Read byte from I/O-mapped device.
#define inw_p(io_addr)   INX_P ( inw, uint16_t, io_addr )
 Read 16-bit word from I/O-mapped device.
#define inl_p(io_addr)   INX_P ( inl, uint32_t, io_addr )
 Read 32-bit dword from I/O-mapped device.
#define OUTX_P(_func, data, io_addr)
 Write value to I/O-mapped device, slowly.
#define outb_p(data, io_addr)   OUTX_P ( outb, data, io_addr )
 Write byte to I/O-mapped device, slowly.
#define outw_p(data, io_addr)   OUTX_P ( outw, data, io_addr )
 Write 16-bit word to I/O-mapped device, slowly.
#define outl_p(data, io_addr)   OUTX_P ( outl, data, io_addr )
 Write 32-bit dword to I/O-mapped device, slowly.
#define rmb()   mb()
#define wmb()   mb()
#define MAX_MEMORY_REGIONS   8
 Maximum number of memory regions we expect to encounter.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
unsigned long phys_to_bus (unsigned long phys_addr)
 Convert physical address to a bus address.
unsigned long bus_to_phys (unsigned long bus_addr)
 Convert bus address to a physical address.
static __always_inline
unsigned long 
virt_to_bus (volatile const void *addr)
 Convert virtual address to a bus address.
static __always_inline void * bus_to_virt (unsigned long bus_addr)
 Convert bus address to a virtual address.
uint8_t readb (volatile uint8_t *io_addr)
 Read byte from memory-mapped device.
uint16_t readw (volatile uint16_t *io_addr)
 Read 16-bit word from memory-mapped device.
uint32_t readl (volatile uint32_t *io_addr)
 Read 32-bit dword from memory-mapped device.
uint64_t readq (volatile uint64_t *io_addr)
 Read 64-bit qword from memory-mapped device.
void writeb (uint8_t data, volatile uint8_t *io_addr)
 Write byte to memory-mapped device.
void writew (uint16_t data, volatile uint16_t *io_addr)
 Write 16-bit word to memory-mapped device.
void writel (uint32_t data, volatile uint32_t *io_addr)
 Write 32-bit dword to memory-mapped device.
void writeq (uint64_t data, volatile uint64_t *io_addr)
 Write 64-bit qword to memory-mapped device.
uint8_t inb (volatile uint8_t *io_addr)
 Read byte from I/O-mapped device.
uint16_t inw (volatile uint16_t *io_addr)
 Read 16-bit word from I/O-mapped device.
uint32_t inl (volatile uint32_t *io_addr)
 Read 32-bit dword from I/O-mapped device.
void outb (uint8_t data, volatile uint8_t *io_addr)
 Write byte to I/O-mapped device.
void outw (uint16_t data, volatile uint16_t *io_addr)
 Write 16-bit word to I/O-mapped device.
void outl (uint32_t data, volatile uint32_t *io_addr)
 Write 32-bit dword to I/O-mapped device.
void insb (volatile uint8_t *io_addr, uint8_t *data, unsigned int count)
 Read bytes from I/O-mapped device.
void insw (volatile uint16_t *io_addr, uint16_t *data, unsigned int count)
 Read 16-bit words from I/O-mapped device.
void insl (volatile uint32_t *io_addr, uint32_t *data, unsigned int count)
 Read 32-bit words from I/O-mapped device.
void outsb (volatile uint8_t *io_addr, const uint8_t *data, unsigned int count)
 Write bytes to I/O-mapped device.
void outsw (volatile uint16_t *io_addr, const uint16_t *data, unsigned int count)
 Write 16-bit words to I/O-mapped device.
void outsl (volatile uint32_t *io_addr, const uint32_t *data, unsigned int count)
 Write 32-bit words to I/O-mapped device.
void iodelay (void)
 Slow down I/O.
void mb (void)
 Memory barrier.
void get_memmap (struct memory_map *memmap)
 Get memory map.

Detailed Description

iPXE I/O API

The I/O API provides methods for reading from and writing to memory-mapped and I/O-mapped devices.

The standard methods (readl()/writel() etc.) do not strictly check the type of the address parameter; this is because traditional usage does not necessarily provide the correct pointer type. For example, code written for ISA devices at fixed I/O addresses (such as the keyboard controller) tend to use plain integer constants for the address parameter.

Definition in file io.h.


Define Documentation

#define PAGE_SIZE   ( 1 << PAGE_SHIFT )
#define PAGE_MASK   ( PAGE_SIZE - 1 )

Page mask.

Definition at line 30 of file io.h.

Referenced by vp_alloc_vq(), and vring_init().

#define IOAPI_INLINE (   _subsys,
  _api_func 
)    SINGLE_API_INLINE ( IOAPI_PREFIX_ ## _subsys, _api_func )

Calculate static inline I/O API function name.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function
Return values:
_subsys_funcSubsystem API function

Definition at line 39 of file io.h.

#define PROVIDE_IOAPI (   _subsys,
  _api_func,
  _func 
)    PROVIDE_SINGLE_API ( IOAPI_PREFIX_ ## _subsys, _api_func, _func )

Provide an I/O API implementation.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function
_funcImplementing function

Definition at line 49 of file io.h.

#define PROVIDE_IOAPI_INLINE (   _subsys,
  _api_func 
)    PROVIDE_SINGLE_API_INLINE ( IOAPI_PREFIX_ ## _subsys, _api_func )

Provide a static inline I/O API implementation.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function

Definition at line 58 of file io.h.

#define IOAPI_READ (   _func,
  _type,
  io_addr,
  _prefix,
  _ndigits 
)
Value:
( {           \
        volatile _type *_io_addr =                                            \
                ( ( volatile _type * ) ( intptr_t ) (io_addr) );              \
        _type _data = _func ( _io_addr );                                     \
        DBGIO ( "[" _prefix " %08lx] => %0" #_ndigits "llx\n",                \
                io_to_bus ( _io_addr ), ( unsigned long long ) _data );       \
        _data; } )

Wrap an I/O read.

Parameters:
_funcI/O API function
_typeData type
io_addrI/O address
_prefixPrefix for address in debug message
_ndigitsNumber of hex digits for this data type

Definition at line 75 of file io.h.

#define IOAPI_WRITE (   _func,
  _type,
  data,
  io_addr,
  _prefix,
  _ndigits 
)
Value:
do {    \
        volatile _type *_io_addr =                                            \
                ( ( volatile _type * ) ( intptr_t ) (io_addr) );              \
        _type _data = (data);                                                 \
        DBGIO ( "[" _prefix " %08lx] <= %0" #_ndigits "llx\n",                \
                io_to_bus ( _io_addr ), ( unsigned long long ) _data );       \
        _func ( _data, _io_addr );                                            \
        } while ( 0 )

Wrap an I/O write.

Parameters:
_funcI/O API function
_typeData type
dataValue to write
io_addrI/O address
_prefixPrefix for address in debug message
_ndigitsNumber of hex digits for this data type

Definition at line 93 of file io.h.

#define IOAPI_READS (   _func,
  _type,
  io_addr,
  data,
  count,
  _prefix,
  _ndigits 
)
Value:
do {                                                                  \
        volatile _type *_io_addr =                                            \
                ( ( volatile _type * ) ( intptr_t ) (io_addr) );              \
        void *_data_void = (data); /* Check data is a pointer */              \
        _type * _data = ( ( _type * ) _data_void );                           \
        const _type * _dbg_data = _data;                                      \
        unsigned int _count = (count);                                        \
        unsigned int _dbg_count = _count;                                     \
        _func ( _io_addr, _data, _count );                                    \
        DBGIO ( "[" _prefix " %08lx] =>", io_to_bus ( _io_addr ) );           \
        while ( _dbg_count-- ) {                                              \
                DBGIO ( " %0" #_ndigits "llx",                                \
                        ( ( unsigned long long ) *(_dbg_data++) ) );          \
        }                                                                     \
        DBGIO ( "\n" );                                                       \
        } while ( 0 )

Wrap an I/O string read.

Parameters:
_funcI/O API function
_typeData type
io_addrI/O address
dataData buffer
countNumber of elements to read
_prefixPrefix for address in debug message
_ndigitsNumber of hex digits for this data type

Definition at line 113 of file io.h.

#define IOAPI_WRITES (   _func,
  _type,
  io_addr,
  data,
  count,
  _prefix,
  _ndigits 
)
Value:
do {                                                                  \
        volatile _type *_io_addr =                                            \
                ( ( volatile _type * ) ( intptr_t ) (io_addr) );              \
        const void *_data_void = (data); /* Check data is a pointer */        \
        const _type * _data = ( ( const _type * ) _data_void );               \
        const _type * _dbg_data = _data;                                      \
        unsigned int _count = (count);                                        \
        unsigned int _dbg_count = _count;                                     \
        DBGIO ( "[" _prefix " %08lx] <=", io_to_bus ( _io_addr ) );           \
        while ( _dbg_count-- ) {                                              \
                DBGIO ( " %0" #_ndigits "llx",                                \
                        ( ( unsigned long long ) *(_dbg_data++) ) );          \
        }                                                                     \
        DBGIO ( "\n" );                                                       \
        _func ( _io_addr, _data, _count );                                    \
        } while ( 0 )

Wrap an I/O string write.

Parameters:
_funcI/O API function
_typeData type
io_addrI/O address
dataData buffer
countNumber of elements to write
_prefixPrefix for address in debug message
_ndigitsNumber of hex digits for this data type

Definition at line 142 of file io.h.

#define readb (   io_addr)    IOAPI_READ ( readb, uint8_t, io_addr, "MEM", 2 )

Definition at line 206 of file io.h.

#define readw (   io_addr)    IOAPI_READ ( readw, uint16_t, io_addr, "MEM", 4 )

Definition at line 215 of file io.h.

#define readl (   io_addr)    IOAPI_READ ( readl, uint32_t, io_addr, "MEM", 8 )

Definition at line 224 of file io.h.

#define readq (   io_addr)    IOAPI_READ ( readq, uint64_t, io_addr, "MEM", 16 )

Definition at line 233 of file io.h.

#define writeb (   data,
  io_addr 
)    IOAPI_WRITE ( writeb, uint8_t, data, io_addr, "MEM", 2 )

Definition at line 242 of file io.h.

#define writew (   data,
  io_addr 
)    IOAPI_WRITE ( writew, uint16_t, data, io_addr, "MEM", 4 )

Definition at line 252 of file io.h.

#define writel (   data,
  io_addr 
)    IOAPI_WRITE ( writel, uint32_t, data, io_addr, "MEM", 8 )

Definition at line 262 of file io.h.

#define writeq (   data,
  io_addr 
)    IOAPI_WRITE ( writeq, uint64_t, data, io_addr, "MEM", 16 )

Definition at line 272 of file io.h.

#define inb (   io_addr)    IOAPI_READ ( inb, uint8_t, io_addr, "IO", 2 )

Definition at line 282 of file io.h.

#define inw (   io_addr)    IOAPI_READ ( inw, uint16_t, io_addr, "IO", 4 )

Definition at line 291 of file io.h.

#define inl (   io_addr)    IOAPI_READ ( inl, uint32_t, io_addr, "IO", 8 )

Definition at line 300 of file io.h.

#define outb (   data,
  io_addr 
)    IOAPI_WRITE ( outb, uint8_t, data, io_addr, "IO", 2 )

Definition at line 309 of file io.h.

#define outw (   data,
  io_addr 
)    IOAPI_WRITE ( outw, uint16_t, data, io_addr, "IO", 4 )

Definition at line 319 of file io.h.

#define outl (   data,
  io_addr 
)    IOAPI_WRITE ( outl, uint32_t, data, io_addr, "IO", 8 )

Definition at line 329 of file io.h.

#define insb (   io_addr,
  data,
  count 
)    IOAPI_READS ( insb, uint8_t, io_addr, data, count, "IO", 2 )

Definition at line 340 of file io.h.

#define insw (   io_addr,
  data,
  count 
)    IOAPI_READS ( insw, uint16_t, io_addr, data, count, "IO", 4 )

Definition at line 351 of file io.h.

#define insl (   io_addr,
  data,
  count 
)    IOAPI_READS ( insl, uint32_t, io_addr, data, count, "IO", 8 )

Definition at line 362 of file io.h.

#define outsb (   io_addr,
  data,
  count 
)    IOAPI_WRITES ( outsb, uint8_t, io_addr, data, count, "IO", 2 )

Definition at line 374 of file io.h.

#define outsw (   io_addr,
  data,
  count 
)    IOAPI_WRITES ( outsw, uint16_t, io_addr, data, count, "IO", 4 )

Definition at line 386 of file io.h.

#define outsl (   io_addr,
  data,
  count 
)    IOAPI_WRITES ( outsl, uint32_t, io_addr, data, count, "IO", 8 )

Definition at line 398 of file io.h.

#define INX_P (   _func,
  _type,
  io_addr 
)
Value:
( {                                   \
        _type _data = _func ( (io_addr) );                                    \
        iodelay();                                                            \
        _data; } )

Read value from I/O-mapped device, slowly.

Parameters:
_funcFunction to use to read value
dataValue to write
io_addrI/O address

Definition at line 414 of file io.h.

#define inb_p (   io_addr)    INX_P ( inb, uint8_t, io_addr )

Read byte from I/O-mapped device.

Parameters:
io_addrI/O address
Return values:
dataValue read

Definition at line 425 of file io.h.

Referenced by mcabus_probe().

#define inw_p (   io_addr)    INX_P ( inw, uint16_t, io_addr )

Read 16-bit word from I/O-mapped device.

Parameters:
io_addrI/O address
Return values:
dataValue read

Definition at line 433 of file io.h.

#define inl_p (   io_addr)    INX_P ( inl, uint32_t, io_addr )

Read 32-bit dword from I/O-mapped device.

Parameters:
io_addrI/O address
Return values:
dataValue read

Definition at line 441 of file io.h.

#define OUTX_P (   _func,
  data,
  io_addr 
)
Value:
do {                                  \
        _func ( (data), (io_addr) );                                          \
        iodelay();                                                            \
        } while ( 0 )

Write value to I/O-mapped device, slowly.

Parameters:
_funcFunction to use to write value
dataValue to write
io_addrI/O address

Definition at line 450 of file io.h.

#define outb_p (   data,
  io_addr 
)    OUTX_P ( outb, data, io_addr )

Write byte to I/O-mapped device, slowly.

Parameters:
dataValue to write
io_addrI/O address

Definition at line 461 of file io.h.

Referenced by mcabus_probe().

#define outw_p (   data,
  io_addr 
)    OUTX_P ( outw, data, io_addr )

Write 16-bit word to I/O-mapped device, slowly.

Parameters:
dataValue to write
io_addrI/O address

Definition at line 469 of file io.h.

#define outl_p (   data,
  io_addr 
)    OUTX_P ( outl, data, io_addr )

Write 32-bit dword to I/O-mapped device, slowly.

Parameters:
dataValue to write
io_addrI/O address

Definition at line 477 of file io.h.

#define rmb ( )    mb()
#define wmb ( )    mb()

Definition at line 485 of file io.h.

Referenced by __vxge_hw_kdfc_swapper_set(), __vxge_hw_legacy_swapper_set(), __vxge_hw_non_offload_db_post(), __vxge_hw_read_rts_ds(), __vxge_hw_vpath_kdfc_configure(), __vxge_hw_vpath_pci_read(), __vxge_hw_vpath_swapper_set(), amd8111e_init_rx_ring(), amd8111e_poll(), amd8111e_transmit(), atl1e_read_phy_reg(), atl1e_reset_hw(), atl1e_tx_queue(), atl1e_write_phy_reg(), b44_transmit(), bnx2_poll(), bnx2_transmit(), clear_b0_fpga_memories(), ehci_async_schedule(), ehci_endpoint_reset(), ehci_enqueue(), ehci_periodic_schedule(), ena_admin(), ena_destroy_admin(), ena_refill_rx(), ena_transmit(), exanic_close(), exanic_open(), exanic_transmit(), falcon_read(), falcon_write(), falcon_write_sram(), flexboot_nodnic_arm_cq(), forcedeth_transmit(), golan_cmd_init(), golan_eq_update_ci(), golan_post_recv(), golan_post_send(), hunt_mcdi_copyin(), icplus_refill_rx(), icplus_transmit(), intel_refill_rx(), intel_transmit(), intelxl_admin_command(), intelxl_poll_admin(), intelxl_refill_rx(), intelxl_transmit(), is_command_finished(), jme_disable_rx_engine(), jme_disable_tx_engine(), jme_enable_rx_engine(), jme_enable_tx_engine(), jme_fill_tx_desc(), jme_mdio_write(), jme_set_clean_rxdesc(), jme_setup_wakeup_frame(), myri10ge_command(), myri10ge_interrupt_handler(), myri10ge_net_poll(), myri10ge_net_transmit(), myri10ge_post_receive(), myson_refill_rx(), myson_transmit(), natsemi_refill_rx(), natsemi_transmit(), nv_alloc_rx(), pci_push(), pcnet32_refill_rx_ring(), pcnet32_setup_init_block(), pcnet32_transmit(), phantom_poll(), phantom_post_cds(), phantom_post_rds(), realtek_refill_rx(), realtek_transmit(), rhine_refill_rx(), rhine_transmit(), send_command(), shomron_tx_uar_send_db(), sis190_give_to_asic(), sis190_make_unusable_by_asic(), sis190_transmit(), skge_poll(), skge_rx_reuse(), skge_rx_setup(), skge_up(), skge_xmit_frame(), sky2_put_idx(), sky2_rx_stop(), txnic_refill_rq(), txnic_send(), uhci_async_schedule(), uhci_describe(), uhci_endpoint_poll(), uhci_enqueue(), uhci_periodic_schedule(), uhci_restart(), velocity_refill_rx(), velocity_transmit(), vmbus_send(), vmxnet3_refill_rx(), vmxnet3_transmit(), vring_add_buf(), vring_detach(), vring_get_buf(), vring_kick(), vring_more_used(), vxge_hw_device_hw_info_get(), vxge_hw_set_fw_api(), vxge_hw_vpath_doorbell_rx(), vxge_open(), xenstore_recv(), xenstore_send(), xhci_doorbell(), and xhci_enqueue().

#define MAX_MEMORY_REGIONS   8

Maximum number of memory regions we expect to encounter.

Definition at line 496 of file io.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
unsigned long phys_to_bus ( unsigned long  phys_addr)

Convert physical address to a bus address.

Parameters:
phys_addrPhysical address
Return values:
bus_addrBus address

Referenced by exanic_open(), and virt_to_bus().

unsigned long bus_to_phys ( unsigned long  bus_addr)

Convert bus address to a physical address.

Parameters:
bus_addrBus address
Return values:
phys_addrPhysical address

Referenced by bus_to_virt().

static __always_inline unsigned long virt_to_bus ( volatile const void *  addr) [inline, static]

Convert virtual address to a bus address.

Parameters:
addrVirtual address
Return values:
bus_addrBus address

Definition at line 183 of file io.h.

References phys_to_bus(), and virt_to_phys().

Referenced by __vxge_hw_vpath_prc_configure(), a3c90x_open(), a3c90x_prepare_rx_desc(), a3c90x_process_tx_packets(), a3c90x_setup_rx_ring(), a3c90x_transmit(), amd8111e_init_rx_ring(), amd8111e_poll(), amd8111e_start(), amd8111e_transmit(), arbel_cmd(), arbel_complete(), arbel_create_cq(), arbel_create_qp(), arbel_create_recv_wq(), arbel_create_send_wq(), arbel_fill_mlx_send_wqe(), arbel_fill_rc_send_wqe(), arbel_fill_ud_send_wqe(), arbel_post_recv(), ath5k_desc_alloc(), ath5k_rx_iob_alloc(), ath5k_txbuf_setup(), ath_descdma_setup(), ath_rx_init(), ath_rx_tasklet(), ath_tx_setup_buffer(), atl1e_setup_ring_resources(), atl1e_tx_map(), b44_address_ok(), bnx2_alloc_mem(), bnx2_init_rx_ring(), bnx2_transmit(), davicom_init_chain(), davicom_reset(), dmfe_descriptor_init(), efx_hunt_alloc_special_buffer(), efx_hunt_build_rx_desc(), efx_hunt_build_tx_desc(), ena_create_cq(), ena_create_sq(), ena_refill_rx(), ena_set_base(), ena_transmit(), epic100_init_ring(), exanic_probe(), falcon_alloc_special_buffer(), falcon_build_rx_desc(), falcon_build_tx_desc(), falcon_init_resources(), flexboot_nodnic_post_recv(), forcedeth_transmit(), golan_cmd_init(), hermon_cmd(), hermon_fill_eth_send_wqe(), hermon_fill_mlx_send_wqe(), hermon_fill_rc_send_wqe(), hermon_fill_ud_send_wqe(), hermon_post_recv(), hunt_mcdi_copyin(), icplus_create_ring(), icplus_refill_rx(), icplus_set_base(), icplus_transmit(), ifec_net_open(), ifec_net_transmit(), ifec_refill_rx_ring(), ifec_reprime_ru(), ifec_tx_setup(), ifec_tx_wake(), igbvf_configure_rx(), igbvf_configure_tx(), igbvf_process_tx_packets(), igbvf_refill_rx_ring(), igbvf_setup_rx_resources(), igbvf_setup_tx_resources(), igbvf_transmit(), init_ring(), intel_create_ring(), intel_refill_rx(), intel_transmit(), intelxl_admin_command(), intelxl_create_admin(), intelxl_create_ring(), intelxl_refill_rx(), intelxl_transmit(), jme_alloc_rx_resources(), jme_alloc_tx_resources(), jme_fill_tx_desc(), jme_set_clean_rxdesc(), jme_tx_clean(), linda_create_recv_wq(), linda_init_send(), linda_post_recv(), mlx_memory_map_dma_priv(), myri10ge_command(), myri10ge_net_open(), myri10ge_net_transmit(), myri10ge_post_receive(), myson_create_ring(), myson_refill_rx(), myson_transmit(), natsemi_create_ring(), natsemi_refill_rx(), natsemi_transmit(), nii_poll_rx(), nii_transmit(), nv_alloc_rx(), nv_init_rings(), pcnet32_open(), pcnet32_process_rx_packets(), pcnet32_process_tx_packets(), pcnet32_refill_rx_ring(), pcnet32_setup_init_block(), pcnet32_setup_rx_resources(), pcnet32_setup_tx_resources(), pcnet32_transmit(), phantom_create_rx_ctx(), phantom_create_tx_ctx(), phantom_issue_buf_cmd(), phantom_poll(), phantom_post_cds(), phantom_post_rds(), phantom_refill_rx_ring(), phantom_transmit(), qib7322_create_recv_wq(), qib7322_init_send(), qib7322_post_recv(), realtek_create_buffer(), realtek_create_ring(), realtek_refill_rx(), realtek_transmit(), rhine_create_ring(), rhine_refill_rx(), rhine_transmit(), rtl818x_handle_rx(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_tx(), shomron_fill_eth_send_wqe(), sis190_alloc_rx_iob(), sis190_open(), sis190_transmit(), sis900_init_rxd(), sis900_init_txd(), sis900_poll(), sis900_transmit(), skge_rx_setup(), skge_up(), skge_xmit_frame(), sky2_probe(), sky2_rx_map_iob(), sky2_up(), sky2_xmit_frame(), tg3_alloc_consistent(), tg3_alloc_rx_iob(), tg3_test_dma(), tg3_transmit(), TLan_FinishReset(), TLan_ResetLists(), txnic_refill_rq(), txnic_send(), velocity_alloc_rings(), vmxnet3_open(), vmxnet3_refill_rx(), vmxnet3_transmit(), vxge_hw_fifo_txdl_buffer_set(), vxge_hw_fifo_txdl_post(), vxge_hw_ring_replenish(), and w89c840_reset().

                                          {
        return phys_to_bus ( virt_to_phys ( addr ) );
}
static __always_inline void* bus_to_virt ( unsigned long  bus_addr) [inline, static]

Convert bus address to a virtual address.

Parameters:
bus_addrBus address
Return values:
addrVirtual address

This operation is not available under all memory models.

Definition at line 195 of file io.h.

References bus_to_phys(), and phys_to_virt().

Referenced by atl1e_probe(), bnx2_poll(), eth_probe(), ne_poll(), ns8390_poll(), ns8390_transmit(), and prism2_find_plx().

                                                                            {
        return phys_to_virt ( bus_to_phys ( bus_addr ) );
}
uint8_t readb ( volatile uint8_t io_addr)
uint16_t readw ( volatile uint16_t io_addr)
uint32_t readl ( volatile uint32_t io_addr)

Read 32-bit dword from memory-mapped device.

Parameters:
io_addrI/O address
Return values:
dataValue read

Referenced by __er32(), _efx_readl(), amd8111e_disable_interrupt(), amd8111e_enable_interrupt(), amd8111e_force_interrupt(), amd8111e_init_hw_default(), amd8111e_poll(), amd8111e_poll_link(), amd8111e_read_phy(), amd8111e_start(), amd8111e_transmit(), amd8111e_wait_link(), arbel_cmd(), arbel_cmd_wait(), ath5k_hw_reg_read(), ath9k_ioread32(), ath9k_reg_rmw(), bflush(), br32(), cmdif_rev(), ehci_async_del(), ehci_bus_poll(), ehci_dump(), ehci_init(), ehci_reset(), ehci_root_disable(), ehci_root_enable(), ehci_root_open(), ehci_root_poll(), ehci_root_speed(), ehci_run(), ehci_stop(), ena_reset(), exanic_check_link(), exanic_i2c_read_bit(), exanic_i2c_write_bit(), exanic_probe(), exanic_probe_port(), forcedeth_link_status(), forcedeth_open(), forcedeth_poll(), fw_rev_maj(), fw_rev_min(), fw_rev_sub(), golan_cmd_init(), hermon_cmd(), hermon_cmd_wait(), hvm_map_shared_info(), icplus_init_phy(), icplus_poll(), icplus_reset(), intel_check_link(), intel_create_ring(), intel_disable_ring(), intel_fetch_mac(), intel_init_eeprom(), intel_open(), intel_poll(), intel_read_eeprom(), intel_reset(), intelvf_mbox_msg(), intelvf_mbox_poll(), intelvf_mbox_read(), intelx_check_link(), intelx_close(), intelx_open(), intelx_poll(), intelx_reset(), intelx_try_fetch_mac(), intelxl_context_dump(), intelxl_context_line(), intelxl_disable_ring(), intelxl_enable_ring(), intelxl_fetch_mac(), intelxl_probe(), intelxl_reset(), intelxvf_check_link(), intelxvf_open(), intelxvf_poll(), intelxvf_stats(), mii_rw(), mlx_pci_mem_read_priv(), myson_poll(), myson_probe(), myson_reload_config(), myson_soft_reset(), myson_wait_idle(), natsemi_check_link(), natsemi_pmatch(), natsemi_poll(), natsemi_reload_config(), natsemi_reset(), natsemi_soft_reset(), natsemi_spi_read_bit(), natsemi_spi_write_bit(), nv_mac_reset(), nv_mgmt_acquire_sema(), nv_mgmt_get_version(), nv_mgmt_release_sema(), nv_setup_mac_addr(), nv_setup_phy(), nv_start_rx(), nv_start_tx(), nv_stop_rx(), nv_stop_tx(), nv_txrx_gate(), nv_update_linkspeed(), nv_update_pause(), pci_push(), phantom_crb_access_128m(), phantom_crb_access_2m(), phantom_crb_access_32m(), phantom_readl(), phy_init(), realtek_init_eeprom(), realtek_mii_read(), realtek_mii_write(), realtek_open(), realtek_poll_tx(), reg_delay(), skge_read32(), sky2_read32(), tg3_get_invariants(), tg3_read32_mbox_5906(), vmxnet3_check_version(), vmxnet3_command(), xenstore_recv(), xenstore_send(), xhci_abort(), xhci_command_free(), xhci_dump(), xhci_dump_port(), xhci_extended_capability(), xhci_init(), xhci_legacy_claim(), xhci_port_protocol(), xhci_port_psiv(), xhci_port_slot_type(), xhci_port_speed(), xhci_port_status(), xhci_reset(), xhci_root_disable(), xhci_root_enable(), xhci_root_open(), xhci_root_speed(), xhci_run(), xhci_stop(), and xhci_supported_protocol().

uint64_t readq ( volatile uint64_t io_addr)
void writeb ( uint8_t  data,
volatile uint8_t io_addr 
)
void writew ( uint16_t  data,
volatile uint16_t io_addr 
)
void writel ( uint32_t  data,
volatile uint32_t io_addr 
)

Write 32-bit dword to memory-mapped device.

Parameters:
dataValue to write
io_addrI/O address

Referenced by __ew32(), _efx_writel(), amd8111e_disable_interrupt(), amd8111e_enable_interrupt(), amd8111e_force_interrupt(), amd8111e_init_hw_default(), amd8111e_poll(), amd8111e_read_phy(), amd8111e_start(), amd8111e_transmit(), arbel_cmd(), arbel_poll_eq(), arbel_reset(), arbel_ring_doorbell(), ath5k_hw_reg_write(), ath9k_iowrite32(), ath9k_reg_rmw(), bw32(), ehci_async_del(), ehci_bus_open(), ehci_bus_poll(), ehci_reset(), ehci_root_close(), ehci_root_disable(), ehci_root_enable(), ehci_root_open(), ehci_root_poll(), ehci_root_speed(), ehci_run(), ehci_stop(), ena_admin(), ena_clear_caps(), ena_refill_rx(), ena_reset(), ena_set_base(), ena_set_caps(), ena_transmit(), exanic_clear_base(), exanic_close(), exanic_expired(), exanic_i2c_write_bit(), exanic_open(), exanic_probe(), exanic_reset(), exanic_transmit(), exanic_write_base(), forcedeth_link_status(), forcedeth_open(), forcedeth_poll(), forcedeth_probe(), forcedeth_transmit(), golan_cmd_init(), golan_eq_update_ci(), hermon_cmd(), hermon_poll_eq(), hermon_post_send(), hermon_reset(), icplus_open(), icplus_reset(), icplus_set_base(), intel_close(), intel_create_ring(), intel_disable_ring(), intel_init_eeprom(), intel_irq(), intel_open(), intel_read_eeprom(), intel_refill_rx(), intel_reset(), intel_reset_ring(), intel_transmit(), intelvf_mbox_msg(), intelvf_mbox_poll(), intelvf_mbox_write(), intelx_close(), intelx_irq(), intelx_open(), intelx_reset(), intelxl_admin_command(), intelxl_close(), intelxl_context_dump(), intelxl_context_line(), intelxl_create_admin(), intelxl_create_ring(), intelxl_destroy_admin(), intelxl_disable_ring(), intelxl_enable_ring(), intelxl_irq(), intelxl_open(), intelxl_poll(), intelxl_probe(), intelxl_refill_admin(), intelxl_refill_rx(), intelxl_reset(), intelxl_transmit(), intelxvf_irq(), intelxvf_open(), intelxvf_reset(), linda_writel(), mii_rw(), mlx_pci_mem_write_priv(), myson_close(), myson_create_ring(), myson_destroy_ring(), myson_irq(), myson_open(), myson_poll(), myson_refill_rx(), myson_reload_config(), myson_reset(), myson_soft_reset(), myson_transmit(), natsemi_check_link(), natsemi_close(), natsemi_create_ring(), natsemi_destroy_ring(), natsemi_irq(), natsemi_open(), natsemi_pmatch(), natsemi_refill_rx(), natsemi_reload_config(), natsemi_reset(), natsemi_soft_reset(), natsemi_spi_write_bit(), natsemi_transmit(), nv_disable_hw_interrupts(), nv_enable_hw_interrupts(), nv_init_rings(), nv_mac_reset(), nv_mgmt_acquire_sema(), nv_mgmt_get_version(), nv_mgmt_release_sema(), nv_setup_phy(), nv_start_rx(), nv_start_tx(), nv_stop_rx(), nv_stop_tx(), nv_txrx_gate(), nv_txrx_reset(), nv_update_linkspeed(), nv_update_pause(), phantom_crb_access_128m(), phantom_crb_access_2m(), phantom_crb_access_32m(), phantom_writel(), phy_init(), qib7322_writel(), realtek_create_buffer(), realtek_create_ring(), realtek_destroy_buffer(), realtek_destroy_ring(), realtek_mii_read(), realtek_mii_write(), realtek_open(), realtek_transmit(), rhine_create_ring(), rhine_destroy_ring(), send_command(), skge_write32(), sky2_write32(), tg3_get_invariants(), tg3_write32_mbox_5906(), velocity_alloc_rings(), velocity_close(), vmxnet3_check_version(), vmxnet3_command(), vmxnet3_open(), vmxnet3_poll_events(), vmxnet3_refill_rx(), vmxnet3_set_ll_addr(), vmxnet3_transmit(), vpm_iowrite32(), xenstore_recv(), xenstore_send(), xhci_doorbell(), xhci_event_alloc(), xhci_event_free(), xhci_legacy_claim(), xhci_port_status(), xhci_reset(), xhci_root_disable(), xhci_root_enable(), xhci_root_open(), xhci_root_speed(), xhci_run(), xhci_stop(), and xhci_writeq().

void writeq ( uint64_t  data,
volatile uint64_t io_addr 
)
uint8_t inb ( volatile uint8_t io_addr)
uint16_t inw ( volatile uint16_t io_addr)
uint32_t inl ( volatile uint32_t io_addr)
void outb ( uint8_t  data,
volatile uint8_t io_addr 
)
void outw ( uint16_t  data,
volatile uint16_t io_addr 
)

Write 16-bit word to I/O-mapped device.

Parameters:
dataValue to write
io_addrI/O address

Referenced by a3c90x_close(), a3c90x_hw_start(), a3c90x_internal_IssueCommand(), a3c90x_internal_ReadEeprom(), a3c90x_remove(), a3c90x_reset(), acpi_poweroff(), check_duplex(), corkscrew_probe1(), cs89x0_probe(), cs89x0_probe_addr(), cs89x0_reset(), cs89x0_transmit(), dm9132_id_table(), eepro_poll(), eepro_reset(), eepro_transmit(), eeprom_read(), eth_pio_write(), get_e(), hfa384x_setreg(), ifec_net_close(), ifec_net_irq(), ifec_net_poll(), ifec_spi_write_bit(), nway_start(), pcnet32_wio_check(), pcnet32_wio_read_bcr(), pcnet32_wio_read_csr(), pcnet32_wio_write_bcr(), pcnet32_wio_write_csr(), pcnet32_wio_write_rap(), phy_write(), pnic_command_quiet(), readreg(), rtl818x_iowrite16(), send_test_pkt(), set_rx_mode(), smc_phy_configure(), smc_read_phy_register(), smc_write_phy_register(), sundance_disable(), sundance_irq(), sundance_poll(), sundance_probe(), sundance_reset(), sundance_transmit(), t509_enable(), t509_poll(), t509_transmit(), t515_disable(), t515_poll(), t515_probe(), t515_reset(), t515_transmit(), t595_disable(), t595_poll(), t595_probe(), t595_reset(), t595_transmit(), t5x9_disable(), t5x9_probe(), TLan_DioRead16(), TLan_DioRead32(), TLan_DioRead8(), TLan_DioWrite16(), TLan_DioWrite32(), TLan_DioWrite8(), TLan_EeReceiveByte(), TLan_EeSendByte(), TLan_EeSendStart(), TLan_MiiReadReg(), TLan_MiiSendData(), TLan_MiiSync(), TLan_MiiWriteReg(), tlan_poll(), tlan_probe(), TLan_ResetAdapter(), uhci_reset(), uhci_root_disable(), uhci_root_enable(), uhci_root_poll(), uhci_root_speed(), uhci_run(), uhci_stop(), vp_del_vq(), vp_find_vq(), vp_notify(), vpm_iowrite16(), vxsetlink(), and writereg().

void outl ( uint32_t  data,
volatile uint32_t io_addr 
)

Write 32-bit dword to I/O-mapped device.

Parameters:
dataValue to write
io_addrI/O address

Referenced by a3c90x_hw_start(), a3c90x_open(), a3c90x_transmit(), davicom_disable(), davicom_media_chk(), davicom_probe(), davicom_reset(), davicom_transmit(), dmfe_descriptor_init(), dmfe_disable(), dmfe_init_dm910x(), dmfe_transmit(), epic100_disable(), epic100_open(), epic100_poll(), epic100_probe(), epic100_transmit(), ifec_mdio_read(), ifec_mdio_write(), ifec_reset(), ifec_scb_cmd(), ifec_tx_wake(), init_media(), mdio_read(), mdio_write(), mii_read(), nway_start(), pcidirect_prepare(), pcnet32_dwio_check(), pcnet32_dwio_read_bcr(), pcnet32_dwio_read_csr(), pcnet32_dwio_write_bcr(), pcnet32_dwio_write_csr(), pcnet32_dwio_write_rap(), phy_read_1bit(), phy_write_1bit(), pnic_do_nway(), read_eeprom(), read_srom_word(), rtl818x_iowrite32(), select_media(), send_filter_frame(), set_rx_mode(), sis635_get_mac_addr(), sis900_check_mode(), sis900_disable(), sis900_init(), sis900_init_rxd(), sis900_init_rxfilter(), sis900_init_txd(), sis900_irq(), sis900_mdio_idle(), sis900_mdio_read(), sis900_mdio_reset(), sis900_poll(), sis900_probe(), sis900_read_eeprom(), sis900_reset(), sis900_set_rx_mode(), sis900_transmit(), sis96x_get_mac_addr(), start_link(), sundance_reset(), sundance_transmit(), t515_reset(), TLan_DioWrite32(), tlan_disable(), TLan_FinishReset(), tlan_poll(), TLan_ResetAdapter(), tlan_transmit(), tulip_disable(), tulip_probe(), tulip_reset(), tulip_transmit(), uhci_bus_open(), update_cr6(), vp_del_vq(), vp_find_vq(), vp_set_features(), vpm_iowrite32(), and vxsetlink().

void insb ( volatile uint8_t io_addr,
uint8_t data,
unsigned int  count 
)

Read bytes from I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of bytes to read

Referenced by pnic_command_quiet().

void insw ( volatile uint16_t io_addr,
uint16_t data,
unsigned int  count 
)

Read 16-bit words from I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of words to read

Referenced by cs89x0_poll(), eepro_poll(), smc9000_poll(), t509_poll(), t515_poll(), and t595_poll().

void insl ( volatile uint32_t io_addr,
uint32_t data,
unsigned int  count 
)

Read 32-bit words from I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of words to read
void outsb ( volatile uint8_t io_addr,
const uint8_t data,
unsigned int  count 
)

Write bytes to I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of bytes to write

Referenced by pnic_command_quiet().

void outsw ( volatile uint16_t io_addr,
const uint16_t data,
unsigned int  count 
)

Write 16-bit words to I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of words to write

Referenced by cs89x0_transmit(), eepro_transmit(), send_test_pkt(), smc9000_transmit(), t509_transmit(), t515_transmit(), and t595_transmit().

void outsl ( volatile uint32_t io_addr,
const uint32_t data,
unsigned int  count 
)

Write 32-bit words to I/O-mapped device.

Parameters:
io_addrI/O address
dataData buffer
countNumber of words to write
void iodelay ( void  )

Slow down I/O.

Referenced by myson_poll().

void mb ( void  )
void get_memmap ( struct memory_map memmap)