19#ifndef _L4UTIL_PORT_IO_H
20#define _L4UTIL_PORT_IO_H
28#include <l4/sys/l4int.h>
175 asm volatile (
"inb %w1, %b0" :
"=a" (value) :
"Nd" (port));
183 asm volatile (
"inw %w1, %w0" :
"=a" (value) :
"Nd" (port));
191 asm volatile (
"inl %w1, %0" :
"=a" (value) :
"Nd" (port));
199 asm volatile (
"rep insb" :
"=D"(dummy1),
"=c"(dummy2)
200 :
"d" (port),
"D" (addr),
"c"(count)
208 asm volatile (
"rep insw" :
"=D"(dummy1),
"=c"(dummy2)
209 :
"d" (port),
"D" (addr),
"c"(count)
217 asm volatile (
"rep insl" :
"=D"(dummy1),
"=c"(dummy2)
218 :
"d" (port),
"D" (addr),
"c"(count)
225 asm volatile (
"outb %b0, %w1" : :
"a" (value),
"Nd" (port));
231 asm volatile (
"outw %w0, %w1" : :
"a" (value),
"Nd" (port));
237 asm volatile (
"outl %0, %w1" : :
"a" (value),
"Nd" (port));
244 asm volatile (
"rep outsb" :
"=S"(dummy1),
"=c"(dummy2)
245 :
"d" (port),
"S" (addr),
"c"(count)
253 asm volatile (
"rep outsw" :
"=S"(dummy1),
"=c"(dummy2)
254 :
"d" (port),
"S" (addr),
"c"(count)
262 asm volatile (
"rep outsl" :
"=S"(dummy1),
"=c"(dummy2)
263 :
"d" (port),
"S" (addr),
"c"(count)
270 asm volatile (
"outb %al,$0x80");
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
unsigned char l4_uint8_t
Unsigned 8bit value.
unsigned int l4_uint32_t
Unsigned 32bit value.
unsigned short int l4_uint16_t
Unsigned 16bit value.
#define L4_INLINE
L4 Inline function attribute.
#define EXTERN_C_BEGIN
Start section with C types and functions.
#define EXTERN_C_END
End section with C types and functions.
l4_uint16_t l4util_in16(l4_uint16_t port)
Read 16-bit-value from I/O port.
void l4util_outs32(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Write block of 32-bit-values to I/O port.
void l4util_out32(l4_uint32_t value, l4_uint16_t port)
Write 32-bit-value to I/O port.
void l4util_out8(l4_uint8_t value, l4_uint16_t port)
Write byte to I/O port.
void l4util_outs8(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Write a block of bytes to I/O port.
void l4util_out16(l4_uint16_t value, l4_uint16_t port)
Write 16-bit-value to I/O port.
void l4util_ins8(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Read a block of 8-bit-values from I/O ports.
l4_uint8_t l4util_in8(l4_uint16_t port)
Read byte from I/O port.
l4_uint32_t l4util_in32(l4_uint16_t port)
Read 32-bit-value from I/O port.
void l4util_outs16(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Write a block of 16-bit-values to I/O port.
void l4util_ins32(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Read a block of 32-bit-values from I/O ports.
void l4util_iodelay(void)
delay I/O port access by writing to port 0x80
void l4util_ins16(l4_uint16_t port, l4_umword_t addr, l4_umword_t count)
Read a block of 16-bit-values from I/O ports.