mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
x86_64 port IO
Added byte port IO with outb() and inb()
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#ifndef _IO_H_INCLUDE
|
||||
#define _IO_H_INCLUDE
|
||||
|
||||
static inline void outb(uint16_t port, uint8_t data){
|
||||
asm("out %%al, %%dx" : : "a"(data), "d"(port));
|
||||
}
|
||||
|
||||
static inline uint8_t inb(uint16_t port){
|
||||
uint8_t ret;
|
||||
asm("in %%dx, %%al" : "=a"(ret) : "d"(port));
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user