17#ifndef _L4UTIL_PORT_IO_H
18#define _L4UTIL_PORT_IO_H
172 unsigned port_start,
unsigned log2size);
190 asm volatile (
"inb %w1, %b0" :
"=a" (value) :
"Nd" (port));
198 asm volatile (
"inw %w1, %w0" :
"=a" (value) :
"Nd" (port));
206 asm volatile (
"inl %w1, %0" :
"=a" (value) :
"Nd" (port));
214 asm volatile (
"rep insb" :
"=D"(dummy1),
"=c"(dummy2)
215 :
"d" (port),
"D" (addr),
"c"(count)
223 asm volatile (
"rep insw" :
"=D"(dummy1),
"=c"(dummy2)
224 :
"d" (port),
"D" (addr),
"c"(count)
232 asm volatile (
"rep insl" :
"=D"(dummy1),
"=c"(dummy2)
233 :
"d" (port),
"D" (addr),
"c"(count)
240 asm volatile (
"outb %b0, %w1" : :
"a" (value),
"Nd" (port));
246 asm volatile (
"outw %w0, %w1" : :
"a" (value),
"Nd" (port));
252 asm volatile (
"outl %0, %w1" : :
"a" (value),
"Nd" (port));
259 asm volatile (
"rep outsb" :
"=S"(dummy1),
"=c"(dummy2)
260 :
"d" (port),
"S" (addr),
"c"(count)
268 asm volatile (
"rep outsw" :
"=S"(dummy1),
"=c"(dummy2)
269 :
"d" (port),
"S" (addr),
"c"(count)
277 asm volatile (
"rep outsl" :
"=S"(dummy1),
"=c"(dummy2)
278 :
"d" (port),
"S" (addr),
"c"(count)
285 asm volatile (
"outb %al,$0x80");
290 unsigned port_start,
unsigned log2size)
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.
unsigned long l4_cap_idx_t
Capability selector type.
@ L4_ENOENT
No such entity.
l4_fpage_t l4_iofpage(unsigned long port, unsigned int order) L4_NOTHROW
Create an IO-port flexpage.
l4_msgtag_t l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Object call (usual invocation).
l4_umword_t l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
Get the IPC error code for an IPC operation.
@ L4_ITEM_MAP
Identify a message item as map item.
unsigned l4_msgtag_items(l4_msgtag_t t) L4_NOTHROW
Get the number of typed items.
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
@ L4_PROTO_IO_PAGE_FAULT
I/O page fault message.
#define L4_IPC_NEVER
never timeout
l4_msg_regs_t * l4_utcb_mr(void) L4_NOTHROW L4_PURE
Get the message-register block of a UTCB.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
l4_buf_regs_t * l4_utcb_br(void) L4_NOTHROW L4_PURE
Get the buffer-register block of a UTCB.
#define L4_INLINE
L4 Inline function attribute.
#define L4_BEGIN_DECLS
Start section with C types and functions.
#define L4_END_DECLS
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.
int l4util_ioport_map(l4_cap_idx_t sigma0id, unsigned port_start, unsigned log2size)
Map a range of I/O ports.
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.
Fixed sized integer types, generic version.
Common L4 ABI Data Types.
l4_umword_t br[L4_UTCB_GENERIC_BUFFERS_SIZE]
Buffer registers.
l4_umword_t bdr
Buffer descriptor.
Message tag data structure.
l4_umword_t raw
Raw value.
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.