Adds io.hpp

This commit is contained in:
Felix Queißner 2016-05-04 16:30:33 +02:00
parent a39395cd12
commit cc7a33b0cf

View file

@ -0,0 +1,13 @@
#pragma once
static inline void outb(uint16_t port, uint8_t data)
{
__asm__ volatile ("outb %0, %1" : : "a" (data), "Nd" (port));
}
static inline uint8_t inb(uint16_t port)
{
uint8_t data;
__asm__ volatile ("inb %1, %0" : "=a" (data) : "d" (port));
return data;
}