ArvernOS
Loading...
Searching...
No Matches
port.h File Reference
#include <stdint.h>
Include dependency graph for port.h:

Functions

uint8_t port_byte_in (uint16_t port)
 
void port_byte_out (uint16_t port, uint8_t value)
 
uint16_t port_word_in (uint16_t port)
 
void port_word_out (uint16_t port, uint16_t value)
 
uint32_t port_dword_in (uint16_t port)
 
void port_dword_out (uint16_t port, uint32_t value)
 

Detailed Description

See also
https://wiki.osdev.org/I/O_Ports

An I/O port is usually used as a technical term for a specific address on the x86's IO bus, which is used to communicate with devices without requiring memory access (alternative). This is the aim of this module.

Function Documentation

◆ port_byte_in()

uint8_t port_byte_in ( uint16_t port)

Reads a byte.

Parameters
porta port number
Returns
the value for the port number

◆ port_byte_out()

void port_byte_out ( uint16_t port,
uint8_t value )

Writes a byte to a port.

Parameters
porta port number
valuethe new value for the port

◆ port_dword_in()

uint32_t port_dword_in ( uint16_t port)

Reads a double word (4 bytes).

Parameters
porta port number
Returns
the value for the port number

◆ port_dword_out()

void port_dword_out ( uint16_t port,
uint32_t value )

Writes a double word to a port.

Parameters
porta port number
valuethe new value for the port

◆ port_word_in()

uint16_t port_word_in ( uint16_t port)

Reads a word (2 bytes).

Parameters
porta port number
Returns
the value for the port number

◆ port_word_out()

void port_word_out ( uint16_t port,
uint16_t value )

Writes a word to a port.

Parameters
porta port number
valuethe new value for the port