diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index e862e5d7..ae860a54 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -26,12 +26,33 @@ extern "C" { inline static unsigned char inportb(unsigned short _port) { unsigned char rv; - __asm__ __volatile__("inb %1, %0":"=a"(rv):"dN"(_port)); - return rv; + asm volatile("inb %1, %0":"=a"(rv):"dN"(_port)); + return rv; } +inline static unsigned short inportw(unsigned short _port) { + unsigned short rv; + asm volatile("inw %1, %0":"=a"(rv):"dN"(_port)); + return rv; +} + +inline static unsigned int inportl(unsigned short _port) { + unsigned int rv; + asm volatile("inl %1, %0":"=a"(rv):"dN"(_port)); + return rv; +} + inline static void outportb(unsigned short _port, unsigned char _data) { - __asm__ __volatile__("outb %1, %0"::"dN"(_port), "a"(_data)); + asm volatile("outb %1, %0"::"dN"(_port), "a"(_data)); +} + +inline static void outportw(unsigned short _port, unsigned short _data) { + asm volatile("outw %1, %0"::"dN"(_port), "a"(_data)); +} + +inline static void outportl(unsigned short _port, unsigned int _data) +{ + asm volatile("outl %1, %0"::"dN"(_port), "a"(_data)); } #ifdef __cplusplus