FENIX_libc/arch/i386/inb.c

12 lines
275 B
C
Raw Normal View History

2020-12-18 18:39:04 +00:00
#include <sys/io.h>
/*
This was practically copied from musl, but it's
not like there's much there to copy anyways.
-Kat
*/
unsigned char inb(unsigned short int port) {
unsigned short val;
__asm__ volatile("inb %1,%0" : "=a" (val) : "dN" (port));
return val;
}