From: Zachary Amsden Move I/O instructions into the sub-arch layer where they can be overridden. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton --- include/asm-i386/io.h | 9 +++++---- include/asm-i386/mach-default/mach_io.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff -puN include/asm-i386/io.h~i386-transparent-paravirtualization-sub-arch-move-sensitive-i-o-instructions-into-the-sub-arch-layer include/asm-i386/io.h --- devel/include/asm-i386/io.h~i386-transparent-paravirtualization-sub-arch-move-sensitive-i-o-instructions-into-the-sub-arch-layer 2005-08-06 15:01:37.000000000 -0700 +++ devel-akpm/include/asm-i386/io.h 2005-08-06 15:01:37.000000000 -0700 @@ -4,6 +4,7 @@ #include #include #include +#include /* * This file contains the definitions for the x86 IO instructions @@ -341,11 +342,11 @@ static inline unsigned type in##bwl(int #define BUILDIO(bwl,bw,type) \ static inline void out##bwl##_local(unsigned type value, int port) { \ - __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \ + __BUILDOUTINST(bwl,bw,value,port); \ } \ static inline unsigned type in##bwl##_local(int port) { \ unsigned type value; \ - __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \ + __BUILDININST(bwl,bw,value,port); \ return value; \ } \ static inline void out##bwl##_local_p(unsigned type value, int port) { \ @@ -368,10 +369,10 @@ static inline unsigned type in##bwl##_p( return value; \ } \ static inline void outs##bwl(int port, const void *addr, unsigned long count) { \ - __asm__ __volatile__("rep; outs" #bwl : "+S"(addr), "+c"(count) : "d"(port)); \ + __BUILDOUTSINST(bwl,addr,count,port); \ } \ static inline void ins##bwl(int port, void *addr, unsigned long count) { \ - __asm__ __volatile__("rep; ins" #bwl : "+D"(addr), "+c"(count) : "d"(port)); \ + __BUILDINSINST(bwl,addr,count,port); \ } BUILDIO(b,b,char) diff -puN include/asm-i386/mach-default/mach_io.h~i386-transparent-paravirtualization-sub-arch-move-sensitive-i-o-instructions-into-the-sub-arch-layer include/asm-i386/mach-default/mach_io.h --- devel/include/asm-i386/mach-default/mach_io.h~i386-transparent-paravirtualization-sub-arch-move-sensitive-i-o-instructions-into-the-sub-arch-layer 2005-08-06 15:01:37.000000000 -0700 +++ devel-akpm/include/asm-i386/mach-default/mach_io.h 2005-08-06 15:01:37.000000000 -0700 @@ -0,0 +1,16 @@ +#ifndef _MACH_ASM_IO_H +#define _MACH_ASM_IO_H + +#define __BUILDOUTINST(bwl,bw,value,port) \ + __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)) +#define __BUILDININST(bwl,bw,value,port) \ + __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)) +#define __BUILDOUTSINST(bwl,addr,count,port) \ + __asm__ __volatile__("rep; outs" #bwl : "+S"(addr), "+c"(count) : "d"(port)) +#define __BUILDINSINST(bwl,addr,count,port) \ + __asm__ __volatile__("rep; ins" #bwl \ + : "+D"(addr), "+c"(count) \ + : "d"(port) \ + : "memory") + +#endif _