io.h File Reference

gPXE I/O API More...

#include <stdint.h>
#include <gpxe/api.h>
#include <config/ioapi.h>
#include <gpxe/uaccess.h>
#include <gpxe/efi/efi_io.h>
#include <bits/io.h>

Go to the source code of this file.

Defines

#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()

Functions

 FILE_LICENCE (GPL2_OR_LATER)
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.
void * ioremap (unsigned long bus_addr, size_t len)
 Map bus address as an I/O address.
void iounmap (volatile const void *io_addr)
 Unmap I/O address.
unsigned long io_to_bus (volatile const void *io_addr)
 Convert I/O address to bus address (for debug only).
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.


Detailed Description

gPXE 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 IOAPI_INLINE ( _subsys,
_api_func   )     SINGLE_API_INLINE ( IOAPI_PREFIX_ ## _subsys, _api_func )

Calculate static inline I/O API function name.

Parameters:
_prefix Subsystem prefix
_api_func API function
Return values:
_subsys_func Subsystem API function

Definition at line 33 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:
_prefix Subsystem prefix
_api_func API function
_func Implementing function

Definition at line 43 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:
_prefix Subsystem prefix
_api_func API function

Definition at line 52 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:
_func I/O API function
_type Data type
io_addr I/O address
_prefix Prefix for address in debug message
_ndigits Number of hex digits for this data type

Definition at line 70 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:
_func I/O API function
_type Data type
data Value to write
io_addr I/O address
_prefix Prefix for address in debug message
_ndigits Number of hex digits for this data type

Definition at line 88 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:
_func I/O API function
_type Data type
io_addr I/O address
data Data buffer
count Number of elements to read
_prefix Prefix for address in debug message
_ndigits Number of hex digits for this data type

Definition at line 108 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:
_func I/O API function
_type Data type
io_addr I/O address
data Data buffer
count Number of elements to write
_prefix Prefix for address in debug message
_ndigits Number of hex digits for this data type

Definition at line 137 of file io.h.

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

Definition at line 225 of file io.h.

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

Definition at line 234 of file io.h.

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

Definition at line 243 of file io.h.

#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 )

Definition at line 261 of file io.h.

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

Definition at line 271 of file io.h.

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

Definition at line 281 of file io.h.

#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 )

Definition at line 338 of file io.h.

Referenced by a3c90x_close(), a3c90x_hw_start(), a3c90x_internal_IssueCommand(), a3c90x_internal_ReadEeprom(), a3c90x_remove(), a3c90x_reset(), 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(), natsemi_open(), natsemi_reset(), 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(), rhine_disable(), rhine_irq(), rhine_poll(), rhine_probe1(), rhine_reset(), rtl818x_iowrite16(), rtl_irq(), rtl_poll(), 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(), vp_del_vq(), vp_find_vq(), vp_notify(), vxsetlink(), WriteMII(), and writereg().

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

Definition at line 348 of file io.h.

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(), m80x_send_cmd_to_phy(), mdio_read(), mdio_write(), mii_read(), mtd_disable(), mtd_poll(), mtd_probe(), mtd_reset(), mtd_transmit(), natsemi_irq(), natsemi_open(), natsemi_poll(), natsemi_reset(), natsemi_transmit(), 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(), rhine_reset(), rtl818x_iowrite32(), rtl_open(), rtl_transmit(), 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(), update_cr6(), vp_del_vq(), vp_find_vq(), vp_set_features(), and vxsetlink().

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

Definition at line 359 of file io.h.

Referenced by pnic_command_quiet().

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

Definition at line 370 of file io.h.

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

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

Definition at line 381 of file io.h.

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

Definition at line 393 of file io.h.

Referenced by pnic_command_quiet().

#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 )

Definition at line 417 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:
_func Function to use to read value
data Value to write
io_addr I/O address

Definition at line 433 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_addr I/O address
Return values:
data Value read

Definition at line 444 of file io.h.

Referenced by empty_8042(), and 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_addr I/O address
Return values:
data Value read

Definition at line 452 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_addr I/O address
Return values:
data Value read

Definition at line 460 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:
_func Function to use to write value
data Value to write
io_addr I/O address

Definition at line 469 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:
data Value to write
io_addr I/O address

Definition at line 480 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:
data Value to write
io_addr I/O address

Definition at line 488 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:
data Value to write
io_addr I/O address

Definition at line 496 of file io.h.

 
#define rmb (  )     mb()

 
#define wmb (  )     mb()


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

unsigned long phys_to_bus ( unsigned long  phys_addr  ) 

Convert physical address to a bus address.

Parameters:
phys_addr Physical address
Return values:
bus_addr Bus address

Referenced by virt_to_bus().

unsigned long bus_to_phys ( unsigned long  bus_addr  ) 

Convert bus address to a physical address.

Parameters:
bus_addr Bus address
Return values:
phys_addr Physical 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:
addr Virtual address
Return values:
bus_addr Bus address

Definition at line 178 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_post_recv(), arbel_post_send(), ath5k_desc_alloc(), ath5k_rx_iob_alloc(), ath5k_txbuf_setup(), atl1e_setup_ring_resources(), atl1e_tx_map(), bnx2_alloc_mem(), bnx2_init_rx_ring(), bnx2_transmit(), davicom_init_chain(), davicom_reset(), dmfe_descriptor_init(), e1000_configure_rx(), e1000_configure_tx(), e1000_refill_rx_ring(), e1000_setup_tx_resources(), e1000_transmit(), e1000e_configure_rx(), e1000e_configure_tx(), e1000e_process_tx_packets(), e1000e_refill_rx_ring(), e1000e_setup_tx_resources(), e1000e_transmit(), epic100_init_ring(), falcon_alloc_special_buffer(), falcon_build_rx_desc(), falcon_build_tx_desc(), falcon_init_resources(), hermon_cmd(), hermon_fill_mlx_send_wqe(), hermon_fill_rc_send_wqe(), hermon_fill_ud_send_wqe(), hermon_post_recv(), ifec_net_open(), ifec_net_transmit(), ifec_refill_rx_ring(), ifec_reprime_ru(), ifec_tx_setup(), ifec_tx_wake(), igb_configure_rx(), igb_configure_tx(), igb_process_tx_packets(), igb_refill_rx_ring(), igb_setup_tx_resources(), igb_transmit(), init_ring(), linda_create_recv_wq(), linda_init_send(), linda_post_recv(), mtd_reset(), mtd_transmit(), mtnic_alloc_aligned(), mtnic_alloc_iobuf(), mtnic_map_cmd(), mtnic_transmit(), myri10ge_command(), myri10ge_net_open(), myri10ge_net_transmit(), myri10ge_post_receive(), natsemi_open(), natsemi_transmit(), pcnet32_probe(), pcnet32_reset(), 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(), rhine_init_ring(), rhine_reset(), rtl8169_populate_rx_descriptor(), rtl8169_process_rx_packets(), rtl8169_process_tx_packets(), rtl8169_setup_rx_resources(), rtl8169_setup_tx_resources(), rtl8169_transmit(), rtl818x_handle_rx(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_tx(), rtl_open(), rtl_set_rx_tx_desc_registers(), rtl_transmit(), 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_init_rings(), tg3_setup_hw(), tg3_transmit(), TLan_FinishReset(), TLan_ResetLists(), velocity_init_rings(), velocity_open(), velocity_transmit(), vxge_hw_fifo_txdl_buffer_set(), vxge_hw_fifo_txdl_post(), vxge_hw_ring_replenish(), vxge_hw_ring_rxd_1b_set(), and w89c840_reset().

00178                                           {
00179         return phys_to_bus ( virt_to_phys ( addr ) );
00180 }

static __always_inline void* bus_to_virt ( unsigned long  bus_addr  )  [inline, static]

Convert bus address to a virtual address.

Parameters:
bus_addr Bus address
Return values:
addr Virtual address
This operation is not available under all memory models.

Definition at line 190 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(), prism2_find_plx(), rhine_reset(), tg3_poll(), and velocity_poll().

00190                                                                             {
00191         return phys_to_virt ( bus_to_phys ( bus_addr ) );
00192 }

void* ioremap ( unsigned long  bus_addr,
size_t  len 
)

void iounmap ( volatile const void *  io_addr  ) 

unsigned long io_to_bus ( volatile const void *  io_addr  ) 

Convert I/O address to bus address (for debug only).

Parameters:
io_addr I/O address
Return values:
bus_addr Bus address

uint8_t readb ( volatile uint8_t io_addr  ) 

Read byte from memory-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read

uint16_t readw ( volatile uint16_t io_addr  ) 

Read 16-bit word from memory-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read

uint32_t readl ( volatile uint32_t io_addr  ) 

Read 32-bit dword from memory-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read

uint64_t readq ( volatile uint64_t io_addr  ) 

Read 64-bit qword from memory-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read

void writeb ( uint8_t  data,
volatile uint8_t io_addr 
)

Write byte to memory-mapped device.

Parameters:
data Value to write
io_addr I/O address

void writew ( uint16_t  data,
volatile uint16_t io_addr 
)

Write 16-bit word to memory-mapped device.

Parameters:
data Value to write
io_addr I/O address

void writel ( uint32_t  data,
volatile uint32_t io_addr 
)

Write 32-bit dword to memory-mapped device.

Parameters:
data Value to write
io_addr I/O address

void writeq ( uint64_t  data,
volatile uint64_t io_addr 
)

Write 64-bit qword to memory-mapped device.

Parameters:
data Value to write
io_addr I/O address

uint8_t inb ( volatile uint8_t io_addr  ) 

Read byte from I/O-mapped device.

Parameters:
io_addr I/O address
Return values:
data Value read

uint16_t inw ( volatile uint16_t io_addr  ) 

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

Parameters:
io_addr I/O address
Return values:
data Value read

uint32_t inl ( volatile uint32_t io_addr  ) 

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

Parameters:
io_addr I/O address
Return values:
data Value read

void outb ( uint8_t  data,
volatile uint8_t io_addr 
)

Write byte to I/O-mapped device.

Parameters:
data Value to write
io_addr I/O address

void outw ( uint16_t  data,
volatile uint16_t io_addr 
)

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

Parameters:
data Value to write
io_addr I/O address

void outl ( uint32_t  data,
volatile uint32_t io_addr 
)

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

Parameters:
data Value to write
io_addr I/O address

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

Read bytes from I/O-mapped device.

Parameters:
io_addr I/O address
data Data buffer
count Number of bytes to read

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

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

Parameters:
io_addr I/O address
data Data buffer
count Number of words to read

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

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

Parameters:
io_addr I/O address
data Data buffer
count Number 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_addr I/O address
data Data buffer
count Number of bytes to write

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_addr I/O address
data Data buffer
count Number of words to write

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_addr I/O address
data Data buffer
count Number of words to write

void iodelay ( void   ) 

Slow down I/O.

Referenced by empty_8042(), gateA20_is_set(), and gateA20_set().

void mb ( void   ) 


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