33#define PORT_MAX UINT16_MAX
74 ASM(
"outb %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
86 ASM(
"inb %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
98 ASM(
"outw %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
110 ASM(
"inw %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
123 ASM(
"inl %1, %0" :
"=a"(ret) :
"Nd"(port) :
"memory");
135 ASM(
"outl %0, %1" : :
"a"(val),
"Nd"(port) :
"memory");
void port_release(port_t base, uint64_t length)
Release a previously reserved range of I/O ports.
static uint16_t in16(port_t port)
Read a 16-bit value from an I/O port.
static void out16(port_t port, uint16_t val)
Write a 16-bit value to an I/O port.
static uint32_t in32(port_t port)
Write a 32-bit value to an I/O port.
static void out8(port_t port, uint8_t val)
Write an 8-bit value to an I/O port.
static uint8_t in8(port_t port)
Read an 8-bit value from an I/O port.
uint64_t port_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.
uint16_t port_t
I/O port type.
static void out32(port_t port, uint32_t val)
Read a 32-bit value from an I/O port.
#define ASM(...)
Inline assembly macro.