Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs
iohelper.h File Reference

Go to the source code of this file.

Data Structures

struct  _ioport
 

Macros

#define IOFUNC_IO(name, hws, ap)
 
#define IOFUNC_IND(name, hws, ap)
 
#define IOFUNC_MEMIO(name, hws, typ, adr)
 
#define ASSIGN_FUNC(typ, name, dest)
 
#define ASSIGN_FUNC_IPAC(typ, target)
 

Typedefs

typedef u8read_reg_func )(void *hwp, u8 offset)
 
typedef voidwrite_reg_func )(void *hwp, u8 offset, u8 value)
 
typedef voidfifo_func )(void *hwp, u8 offset, u8 *datap, int size)
 

Macro Definition Documentation

#define ASSIGN_FUNC (   typ,
  name,
  dest 
)
Value:
do { \
dest.read_reg = &Read##name##_##typ; \
dest.write_reg = &Write##name##_##typ; \
dest.read_fifo = &ReadFiFo##name##_##typ; \
dest.write_fifo = &WriteFiFo##name##_##typ; \
} while (0)

Definition at line 98 of file iohelper.h.

#define ASSIGN_FUNC_IPAC (   typ,
  target 
)
Value:
do { \
ASSIGN_FUNC(typ, ISAC, target.isac); \
ASSIGN_FUNC(typ, IPAC, target); \
} while (0)

Definition at line 104 of file iohelper.h.

#define IOFUNC_IND (   name,
  hws,
  ap 
)
Value:
static u8 Read##name##_IND(void *p, u8 off) { \
struct hws *hw = p; \
outb(off, hw->ap.ale); \
return inb(hw->ap.port); \
} \
static void Write##name##_IND(void *p, u8 off, u8 val) { \
struct hws *hw = p; \
outb(off, hw->ap.ale); \
outb(val, hw->ap.port); \
} \
static void ReadFiFo##name##_IND(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
outb(off, hw->ap.ale); \
insb(hw->ap.port, dp, size); \
} \
static void WriteFiFo##name##_IND(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
outb(off, hw->ap.ale); \
outsb(hw->ap.port, dp, size); \
}

Definition at line 56 of file iohelper.h.

#define IOFUNC_IO (   name,
  hws,
  ap 
)
Value:
static u8 Read##name##_IO(void *p, u8 off) { \
struct hws *hw = p; \
return inb(hw->ap.port + off); \
} \
static void Write##name##_IO(void *p, u8 off, u8 val) { \
struct hws *hw = p; \
outb(val, hw->ap.port + off); \
} \
static void ReadFiFo##name##_IO(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
insb(hw->ap.port + off, dp, size); \
} \
static void WriteFiFo##name##_IO(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
outsb(hw->ap.port + off, dp, size); \
}

Definition at line 38 of file iohelper.h.

#define IOFUNC_MEMIO (   name,
  hws,
  typ,
  adr 
)
Value:
static u8 Read##name##_MIO(void *p, u8 off) { \
struct hws *hw = p; \
return readb(((typ *)hw->adr) + off); \
} \
static void Write##name##_MIO(void *p, u8 off, u8 val) { \
struct hws *hw = p; \
writeb(val, ((typ *)hw->adr) + off); \
} \
static void ReadFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
while (size--) \
*dp++ = readb(((typ *)hw->adr) + off); \
} \
static void WriteFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) { \
struct hws *hw = p; \
while (size--) \
writeb(*dp++, ((typ *)hw->adr) + off); \
}

Definition at line 78 of file iohelper.h.

Typedef Documentation

typedef void( fifo_func)(void *hwp, u8 offset, u8 *datap, int size)

Definition at line 31 of file iohelper.h.

typedef u8( read_reg_func)(void *hwp, u8 offset)

Definition at line 29 of file iohelper.h.

typedef void( write_reg_func)(void *hwp, u8 offset, u8 value)

Definition at line 30 of file iohelper.h.