From 5d139a151937429e3251ef5699fa08c44224e834 Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 5 Aug 2010 07:11:38 +0000 Subject: [PATCH] - add additional inport and outport functions (wl) git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@41 315a16e6-25f9-4109-90ae-ca3045a26c18 --- arch/x86/include/asm/io.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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