2024-05-21 18:41:16 +03:00
|
|
|
#include "io.h"
|
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
void outb(uint16_t port, uint8_t val)
|
|
|
|
{
|
|
|
|
asm volatile("outb %0, %1" : : "a"(val), "Nd"(port));
|
2024-05-21 18:41:16 +03:00
|
|
|
}
|
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
uint8_t inb(uint16_t port)
|
|
|
|
{
|
2024-05-21 18:41:16 +03:00
|
|
|
uint8_t ret;
|
2024-05-23 20:59:18 +03:00
|
|
|
asm volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
|
2024-05-21 18:41:16 +03:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void io_wait(void)
|
|
|
|
{
|
2024-05-23 20:59:18 +03:00
|
|
|
asm volatile("jmp 1f\n\t"
|
|
|
|
"1:jmp 2f\n\t"
|
|
|
|
"2:");
|
2024-05-21 18:41:16 +03:00
|
|
|
}
|