Adds io.hpp
This commit is contained in:
parent
a39395cd12
commit
cc7a33b0cf
1 changed files with 13 additions and 0 deletions
13
prototypes/base/include/io.hpp
Normal file
13
prototypes/base/include/io.hpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in a new issue