32#define IO_PORT_MAX UINT16_MAX
73 asm volatile(
"outb %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
85 asm volatile(
"inb %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
97 asm volatile(
"outw %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
109 asm volatile(
"inw %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
122 asm volatile(
"inl %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
134 asm volatile(
"outl %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
static void io_out8(port_t port, uint8_t val)
Write an 8-bit value to an I/O port.
static void io_out32(port_t port, uint32_t val)
Read a 32-bit value from an I/O port.
static uint16_t io_in16(port_t port)
Read a 16-bit value from an I/O port.
uint64_t io_reserve(port_t *out, port_t minBase, port_t maxBase, uint64_t alignment, uint64_t length, const char *owner)
Find and reserve a range of I/O ports if available.
static void io_out16(port_t port, uint16_t val)
Write a 16-bit value to an I/O port.
void io_release(port_t base, uint64_t length)
Release a previously reserved range of I/O ports.
static uint8_t io_in8(port_t port)
Read an 8-bit value from an I/O port.
uint16_t port_t
I/O port type.
static uint32_t io_in32(port_t port)
Write a 32-bit value to an I/O port.