11 static inline unsigned char inportb(
unsigned short port)
14 __asm__ __volatile__(
"inb %%dx, %%al"
24 static inline unsigned short inports(
unsigned short port)
26 unsigned short result;
27 __asm__ __volatile__(
"inw %1, %0"
37 static inline unsigned int inportl(
unsigned short port)
40 __asm__ __volatile__(
"inl %%dx, %%eax"
50 static inline void outportb(
unsigned short port,
unsigned char value)
52 __asm__ __volatile__(
"outb %%al, %%dx"
54 :
"a"(value),
"dN"(port)
61 static inline void outports(
unsigned short port,
unsigned short value)
63 __asm__ __volatile__(
"outw %1, %0"
65 :
"dN"(port),
"a"(value)
72 static inline void outportl(
unsigned short port,
unsigned int value)
74 __asm__ __volatile__(
"outl %%eax, %%dx"
76 :
"dN"(port),
"a"(value)
84 static inline void inportsb(
unsigned short port,
void *addr,
unsigned long count)
88 :
"=D"(addr),
"=c"(count)
89 :
"d"(port),
"0"(addr),
"1"(count));
96 static inline void inportsw(
unsigned short port,
void *addr,
unsigned long count)
100 :
"=D"(addr),
"=c"(count)
101 :
"d"(port),
"0"(addr),
"1"(count));
108 static inline void inportsl(
unsigned short port,
void *addr,
unsigned long count)
110 __asm__ __volatile__(
112 :
"=D"(addr),
"=c"(count)
113 :
"d"(port),
"0"(addr),
"1"(count));
120 static inline void outportsb(
unsigned short port,
void *addr,
unsigned long count)
122 __asm__ __volatile__(
124 :
"=S"(addr),
"=c"(count)
125 :
"d"(port),
"0"(addr),
"1"(count));
132 static inline void outportsw(
unsigned short port,
void *addr,
unsigned long count)
134 __asm__ __volatile__(
136 :
"=S"(addr),
"=c"(count)
137 :
"d"(port),
"0"(addr),
"1"(count));
144 static inline void outportsl(
unsigned short port,
void *addr,
unsigned long count)
146 __asm__ __volatile__(
148 :
"=S"(addr),
"=c"(count)
149 :
"d"(port),
"0"(addr),
"1"(count));
static void outportsl(unsigned short port, void *addr, unsigned long count)
Writes multiple 32-bit values to the given port.
Definition: port_io.h:144
static unsigned int inportl(unsigned short port)
Reads a 32-bit value from the given port.
Definition: port_io.h:37
static void outportl(unsigned short port, unsigned int value)
Writes a 32-bit value at the given port.
Definition: port_io.h:72
static void inportsl(unsigned short port, void *addr, unsigned long count)
Reads multiple 32-bit values from the given port.
Definition: port_io.h:108
static unsigned short inports(unsigned short port)
Reads a 16-bit value from the given port.
Definition: port_io.h:24
static void inportsw(unsigned short port, void *addr, unsigned long count)
Reads multiple 16-bit values from the given port.
Definition: port_io.h:96
static void outportsb(unsigned short port, void *addr, unsigned long count)
Writes multiple 8-bit values to the given port.
Definition: port_io.h:120
static void inportsb(unsigned short port, void *addr, unsigned long count)
Reads multiple 8-bit values from the given port.
Definition: port_io.h:84
static void outports(unsigned short port, unsigned short value)
Writes a 16-bit value at the given port.
Definition: port_io.h:61
static void outportb(unsigned short port, unsigned char value)
Writes a 8-bit value at the given port.
Definition: port_io.h:50
static unsigned char inportb(unsigned short port)
Reads a 8-bit value from the given port.
Definition: port_io.h:11
static void outportsw(unsigned short port, void *addr, unsigned long count)
Writes multiple 16-bit values to the given port.
Definition: port_io.h:132