iPXE
Macros | Functions
dummy_pio.h File Reference

Dummy PIO reads and writes up to 32 bits. More...

Go to the source code of this file.

Macros

#define DUMMY_INX(_prefix, _suffix, _type)
 
#define DUMMY_OUTX(_prefix, _suffix, _type)
 
#define DUMMY_IODELAY(_prefix)
 
#define DUMMY_PIO(_prefix)
 
#define PROVIDE_DUMMY_PIO(_prefix)
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 

Detailed Description

Dummy PIO reads and writes up to 32 bits.

There is no common standard for I/O-space access for non-x86 CPU families, and non-MMIO peripherals are vanishingly rare. Provide dummy implementations that will allow code to link and should cause drivers to simply fail to detect hardware at runtime.

Definition in file dummy_pio.h.

Macro Definition Documentation

◆ DUMMY_INX

#define DUMMY_INX (   _prefix,
  _suffix,
  _type 
)
Value:
static inline __always_inline _type \
IOAPI_INLINE ( _prefix, in ## _suffix ) ( volatile _type *io_addr __unused) { \
return ~( (_type) 0 ); \
} \
static inline __always_inline void \
IOAPI_INLINE ( _prefix, ins ## _suffix ) ( volatile _type *io_addr __unused, \
_type *data, unsigned int count ) {\
memset ( data, 0xff, count * sizeof ( *data ) ); \
}
__be32 in[4]
Definition: CIB_PRM.h:35
#define __always_inline
Declare a function to be always inline.
Definition: compiler.h:611
#define __unused
Declare a variable or data structure as unused.
Definition: compiler.h:573
#define IOAPI_INLINE(_subsys, _api_func)
Calculate static inline I/O API function name.
Definition: io.h:39
uint16_t count
Number of entries.
Definition: ena.h:22
uint8_t data[48]
Additional event data.
Definition: ena.h:22

Definition at line 16 of file dummy_pio.h.

◆ DUMMY_OUTX

#define DUMMY_OUTX (   _prefix,
  _suffix,
  _type 
)
Value:
static inline __always_inline void \
IOAPI_INLINE ( _prefix, out ## _suffix ) ( _type data __unused, \
volatile _type *io_addr __unused ){\
/* Do nothing */ \
} \
static inline __always_inline void \
IOAPI_INLINE ( _prefix, outs ## _suffix ) ( volatile _type *io_addr __unused, \
const _type *data __unused, \
unsigned int count __unused ) { \
/* Do nothing */ \
}
__be32 out[4]
Definition: CIB_PRM.h:36
#define __always_inline
Declare a function to be always inline.
Definition: compiler.h:611
#define __unused
Declare a variable or data structure as unused.
Definition: compiler.h:573
#define IOAPI_INLINE(_subsys, _api_func)
Calculate static inline I/O API function name.
Definition: io.h:39
uint16_t count
Number of entries.
Definition: ena.h:22
uint8_t data[48]
Additional event data.
Definition: ena.h:22

Definition at line 27 of file dummy_pio.h.

◆ DUMMY_IODELAY

#define DUMMY_IODELAY (   _prefix)
Value:
static inline __always_inline void \
IOAPI_INLINE ( _prefix, iodelay ) ( void ) { \
/* Nothing to do */ \
}
#define __always_inline
Declare a function to be always inline.
Definition: compiler.h:611
#define IOAPI_INLINE(_subsys, _api_func)
Calculate static inline I/O API function name.
Definition: io.h:39
void iodelay(void)
Slow down I/O.

Definition at line 40 of file dummy_pio.h.

◆ DUMMY_PIO

#define DUMMY_PIO (   _prefix)
Value:
DUMMY_INX ( _prefix, b, uint8_t ); \
DUMMY_INX ( _prefix, w, uint16_t ); \
DUMMY_INX ( _prefix, l, uint32_t ); \
DUMMY_OUTX ( _prefix, b, uint8_t ); \
DUMMY_OUTX ( _prefix, w, uint16_t ); \
DUMMY_OUTX ( _prefix, l, uint32_t ); \
DUMMY_IODELAY ( _prefix );
unsigned short uint16_t
Definition: stdint.h:11
uint8_t l
Definition: registers.h:15
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
uint32_t w[16]
Definition: md4.c:32
#define DUMMY_INX(_prefix, _suffix, _type)
Definition: dummy_pio.h:16
uint32_t b
Definition: md4.c:29

Definition at line 46 of file dummy_pio.h.

◆ PROVIDE_DUMMY_PIO

#define PROVIDE_DUMMY_PIO (   _prefix)
Value:
PROVIDE_IOAPI_INLINE ( _prefix, inb ); \
PROVIDE_IOAPI_INLINE ( _prefix, inw ); \
PROVIDE_IOAPI_INLINE ( _prefix, inl ); \
PROVIDE_IOAPI_INLINE ( _prefix, outb ); \
PROVIDE_IOAPI_INLINE ( _prefix, outw ); \
PROVIDE_IOAPI_INLINE ( _prefix, outl ); \
PROVIDE_IOAPI_INLINE ( _prefix, iodelay );
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
#define outw(data, io_addr)
Definition: io.h:319
#define outl(data, io_addr)
Definition: io.h:329
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
#define PROVIDE_IOAPI_INLINE(_subsys, _api_func)
Provide a static inline I/O API implementation.
Definition: io.h:58
#define outb(data, io_addr)
Definition: io.h:309
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
void iodelay(void)
Slow down I/O.

Definition at line 55 of file dummy_pio.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )