c wrappers for asm port operations
More...
#include "stdint.h"
Go to the source code of this file.
|
| static uint8_t | inb (uint16_t port) |
| | read byte from low level port
|
| |
| static void | outb (uint16_t port, uint8_t val) |
| | write byte to low level port
|
| |
| static uint16_t | inw (uint16_t port) |
| | read word from low level port
|
| |
| static void | outw (uint16_t port, uint16_t val) |
| | write word to low level port
|
| |
| static uint32_t | inl (uint16_t port) |
| | read double word from low level port
|
| |
| static void | outl (uint16_t port, uint32_t val) |
| | write double word to low level port
|
| |
| static void | io_wait (void) |
| | perform a short wait (1-4 microseconds)
|
| |
c wrappers for asm port operations
◆ inb()
| static uint8_t inb |
( |
uint16_t |
port | ) |
|
|
inlinestatic |
read byte from low level port
- Parameters
-
- Returns
- value in port
◆ inl()
| static uint32_t inl |
( |
uint16_t |
port | ) |
|
|
inlinestatic |
read double word from low level port
- Parameters
-
- Returns
- value in port
◆ inw()
| static uint16_t inw |
( |
uint16_t |
port | ) |
|
|
inlinestatic |
read word from low level port
- Parameters
-
- Returns
- value in port
◆ io_wait()
| static void io_wait |
( |
void |
| ) |
|
|
inlinestatic |
perform a short wait (1-4 microseconds)
This function outputs to a random unused port (0x80 is almost always unused after booting) Since output takes some time, this function can work as a small wait
◆ outb()
| static void outb |
( |
uint16_t |
port, |
|
|
uint8_t |
val |
|
) |
| |
|
inlinestatic |
write byte to low level port
- Parameters
-
| port | port to write to |
| val | value to write to port |
◆ outl()
| static void outl |
( |
uint16_t |
port, |
|
|
uint32_t |
val |
|
) |
| |
|
inlinestatic |
write double word to low level port
- Parameters
-
| port | port to write to |
| val | value to write to port |
◆ outw()
| static void outw |
( |
uint16_t |
port, |
|
|
uint16_t |
val |
|
) |
| |
|
inlinestatic |
write word to low level port
- Parameters
-
| port | port to write to |
| val | value to write to port |