I/O-port session interface

An I/O port session permits access to a range of ports. Inside this range variable-sized accesses (i.e., 8, 16, 32 bit) at arbitrary addresses are allowed - currently, alignment is not enforced. Core enforces that access is limited to the session-defined range while the user provides physical I/O port addresses as function parameters.

The design is founded on experiences while programming PCI configuration space which needs two 32-bit port registers. Each byte, word and dword in the data register must be explicitly accessible for read and write. The old design needs six capabilities only for the data register.

Class Genode::Io_port_session

Public functions

inb

Read byte (8 bit)

Argument
short address Physical i/o port address
Return

unsigned char Value read from port

inl

Read double word (32 bit)

Argument
short address Physical i/o port address
Return

unsigned Value read from port

inw

Read word (16 bit)

Argument
short address Physical i/o port address
Return

unsigned short Value read from port

outb

Write byte (8 bit)

Arguments
short address Physical i/o port address
char value Value to write to port

outl

Write double word (32 bit)

Argument
short address Physical i/o port address

outw

Write word (16 bit)

Arguments
short address Physical i/o port address
short value Value to write to port

service_name

Return

char *