Go to the documentation of this file.
38 #define IOFUNC_IO(name, hws, ap) \
39 static u8 Read##name##_IO(void *p, u8 off) { \
41 return inb(hw->ap.port + off); \
43 static void Write##name##_IO(void *p, u8 off, u8 val) { \
45 outb(val, hw->ap.port + off); \
47 static void ReadFiFo##name##_IO(void *p, u8 off, u8 *dp, int size) { \
49 insb(hw->ap.port + off, dp, size); \
51 static void WriteFiFo##name##_IO(void *p, u8 off, u8 *dp, int size) { \
53 outsb(hw->ap.port + off, dp, size); \
56 #define IOFUNC_IND(name, hws, ap) \
57 static u8 Read##name##_IND(void *p, u8 off) { \
59 outb(off, hw->ap.ale); \
60 return inb(hw->ap.port); \
62 static void Write##name##_IND(void *p, u8 off, u8 val) { \
64 outb(off, hw->ap.ale); \
65 outb(val, hw->ap.port); \
67 static void ReadFiFo##name##_IND(void *p, u8 off, u8 *dp, int size) { \
69 outb(off, hw->ap.ale); \
70 insb(hw->ap.port, dp, size); \
72 static void WriteFiFo##name##_IND(void *p, u8 off, u8 *dp, int size) { \
74 outb(off, hw->ap.ale); \
75 outsb(hw->ap.port, dp, size); \
78 #define IOFUNC_MEMIO(name, hws, typ, adr) \
79 static u8 Read##name##_MIO(void *p, u8 off) { \
81 return readb(((typ *)hw->adr) + off); \
83 static void Write##name##_MIO(void *p, u8 off, u8 val) { \
85 writeb(val, ((typ *)hw->adr) + off); \
87 static void ReadFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) { \
90 *dp++ = readb(((typ *)hw->adr) + off); \
92 static void WriteFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) { \
95 writeb(*dp++, ((typ *)hw->adr) + off); \
98 #define ASSIGN_FUNC(typ, name, dest) do { \
99 dest.read_reg = &Read##name##_##typ; \
100 dest.write_reg = &Write##name##_##typ; \
101 dest.read_fifo = &ReadFiFo##name##_##typ; \
102 dest.write_fifo = &WriteFiFo##name##_##typ; \
104 #define ASSIGN_FUNC_IPAC(typ, target) do { \
105 ASSIGN_FUNC(typ, ISAC, target.isac); \
106 ASSIGN_FUNC(typ, IPAC, target); \