summaryrefslogtreecommitdiff
path: root/kernel/src/cpu/io.c
blob: 6bf67d05498ac5823ef5be4e42166980ae6fccd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdint.h>

uint8_t inb(uint32_t port)
{
	uint8_t ret;
	__asm__ volatile ("inb %%dx, %%al" : "=a"(ret) : "d"(port));
	return ret;
}

void outb(uint32_t port, uint8_t value)
{
	__asm__ volatile ("outb %%al, %%dx" : : "d"(port), "a"(value));
}