17#ifndef _L4UTIL_PORT_IO_H
18#define _L4UTIL_PORT_IO_H
26#include <l4/sys/l4int.h>
171 asm volatile (
"inb %w1, %b0" :
"=a" (value) :
"Nd" (port));
179 asm volatile (
"inw %w1, %w0" :
"=a" (value) :
"Nd" (port));
187 asm volatile (
"inl %w1, %0" :
"=a" (value) :
"Nd" (port));
195 asm volatile (
"rep insb" :
"=D"(dummy1),
"=c"(dummy2)
196 :
"d" (port),
"D" (addr),
"c"(count)
204 asm volatile (
"rep insw" :
"=D"(dummy1),
"=c"(dummy2)
205 :
"d" (port),
"D" (addr),
"c"(count)
213 asm volatile (
"rep insl" :
"=D"(dummy1),
"=c"(dummy2)
214 :
"d" (port),
"D" (addr),
"c"(count)
221 asm volatile (
"outb %b0, %w1" : :
"a" (value),
"Nd" (port));
227 asm volatile (
"outw %w0, %w1" : :
"a" (value),
"Nd" (port));
233 asm volatile (
"outl %0, %w1" : :
"a" (value),
"Nd" (port));
240 asm volatile (
"rep outsb" :
"=S"(dummy1),
"=c"(dummy2)
241 :
"d" (port),
"S" (addr),
"c"(count)
249 asm volatile (
"rep outsw" :
"=S"(dummy1),
"=c"(dummy2)
250 :
"d" (port),
"S" (addr),
"c"(count)
258 asm volatile (
"rep outsl" :
"=S"(dummy1),
"=c"(dummy2)
259 :
"d" (port),
"S" (addr),
"c"(count)
266 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 __END_DECLS
End section with C types and functions.
#define L4_INLINE
L4 Inline function attribute.
#define __BEGIN_DECLS
Start 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.