Kernel: Add inw and outw to IO

This commit is contained in:
Bananymous 2023-02-04 23:37:34 +02:00
parent 6fab26692b
commit fb7fe73d49
1 changed files with 12 additions and 0 deletions

View File

@ -17,6 +17,18 @@ namespace IO
return ret; return ret;
} }
static inline void outw(uint16_t port, uint16_t val)
{
asm volatile("outw %0, %1" : : "a"(val), "Nd"(port));
}
static inline uint16_t inw(uint16_t port)
{
uint16_t ret;
asm volatile("inw %1, %0" : "=a"(ret) : "Nd"(port));
return ret;
}
static inline void io_wait() static inline void io_wait()
{ {
outb(0x80, 0); outb(0x80, 0);