Provides utilities for IO operations with the hardware.
More...
#include <stdint.h>
Go to the source code of this file.
|
| void | outb (uint16_t port, uint8_t value) |
| | Outputs a byte to the specified port.
|
| uint8_t | inb (uint16_t port) |
| | Inputs a byte from the specified port.
|
| void | outw (uint32_t port, uint16_t value) |
| | Outputs 2 bytes to the specified port.
|
| uint16_t | inw (uint32_t port) |
| | Inputs 2 bytes from the specified port.
|
| void | outl (uint32_t port, uint32_t value) |
| | Outputs 4 bytes to the specified port.
|
| uint32_t | inl (uint32_t port) |
| | Inputs 4 bytes from the specified port.
|
| void | io_wait (void) |
| | Write 0 to unused port 0x80 to perform a short pause.
|
| static uint64_t | rdmsr (uint32_t msr) |
| static void | wrmsr (uint32_t msr, uint64_t value) |
Provides utilities for IO operations with the hardware.
- Author
- Matheus Boscariol
- Since
- 15/11/2026
- Copyright
- (c) 2026 Matheus Boscariol. Licensed under GNU AGPL-3.0.
Definition in file io.h.
◆ COM1
Definition at line 13 of file io.h.
◆ inb()
| uint8_t inb |
( |
uint16_t | port | ) |
|
|
inline |
Inputs a byte from the specified port.
- Parameters
-
| port | The port to input from |
- Returns
- The value input
Definition at line 31 of file io.h.
◆ inl()
| uint32_t inl |
( |
uint32_t | port | ) |
|
|
inline |
Inputs 4 bytes from the specified port.
- Parameters
-
| port | The port to input from |
- Returns
- The value input
Definition at line 74 of file io.h.
◆ inw()
| uint16_t inw |
( |
uint32_t | port | ) |
|
|
inline |
Inputs 2 bytes from the specified port.
- Parameters
-
| port | The port to input from |
- Returns
- The value input
Definition at line 52 of file io.h.
◆ io_wait()
Write 0 to unused port 0x80 to perform a short pause.
Definition at line 83 of file io.h.
◆ outb()
| void outb |
( |
uint16_t | port, |
|
|
uint8_t | value ) |
|
inline |
Outputs a byte to the specified port.
- Parameters
-
| port | The port to output to |
| value | The value to output |
Definition at line 22 of file io.h.
◆ outl()
| void outl |
( |
uint32_t | port, |
|
|
uint32_t | value ) |
|
inline |
Outputs 4 bytes to the specified port.
- Parameters
-
| port | The port to output to |
| value | The value to output |
Definition at line 65 of file io.h.
◆ outw()
| void outw |
( |
uint32_t | port, |
|
|
uint16_t | value ) |
|
inline |
Outputs 2 bytes to the specified port.
- Parameters
-
| port | The port to output to |
| value | The value to output |
Definition at line 43 of file io.h.
◆ rdmsr()
| uint64_t rdmsr |
( |
uint32_t | msr | ) |
|
|
inlinestatic |
Definition at line 88 of file io.h.
◆ wrmsr()
| void wrmsr |
( |
uint32_t | msr, |
|
|
uint64_t | value ) |
|
inlinestatic |
Definition at line 95 of file io.h.