aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/io_64.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:10 -0500
commitba082427ae6ffbf8e48a26ae4f72f4501a6b80c1 (patch)
tree88c48bd8a3be3639a8fa8e0451fb536fde7d2361 /include/asm-x86/io_64.h
parentee238e5ca66858f80170f87724f84d67183b069a (diff)
x86: tweak io_64.h for paravirt.
We need something here because we can't call in and out instructions directly. However, we have to be careful, because no indirections are allowed in misc_64.c , and paravirt_ops is a kind of one. So just call it directly there Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/io_64.h')
-rw-r--r--include/asm-x86/io_64.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h
index dbcc03aa1c6a..fef0ce2ced81 100644
--- a/include/asm-x86/io_64.h
+++ b/include/asm-x86/io_64.h
@@ -40,6 +40,10 @@ extern void native_io_delay(void);
40extern int io_delay_type; 40extern int io_delay_type;
41extern void io_delay_init(void); 41extern void io_delay_init(void);
42 42
43#if defined(CONFIG_PARAVIRT)
44#include <asm/paravirt.h>
45#else
46
43static inline void slow_down_io(void) 47static inline void slow_down_io(void)
44{ 48{
45 native_io_delay(); 49 native_io_delay();
@@ -49,6 +53,7 @@ static inline void slow_down_io(void)
49 native_io_delay(); 53 native_io_delay();
50#endif 54#endif
51} 55}
56#endif
52 57
53/* 58/*
54 * Talk about misusing macros.. 59 * Talk about misusing macros..
@@ -57,21 +62,32 @@ static inline void slow_down_io(void)
57static inline void out##s(unsigned x value, unsigned short port) { 62static inline void out##s(unsigned x value, unsigned short port) {
58 63
59#define __OUT2(s,s1,s2) \ 64#define __OUT2(s,s1,s2) \
60__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" : : "a" (value), "Nd" (port)) 65__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
66
67#ifndef REALLY_SLOW_IO
68#define REALLY_SLOW_IO
69#define UNSET_REALLY_SLOW_IO
70#endif
61 71
62#define __OUT(s,s1,x) \ 72#define __OUT(s,s1,x) \
63__OUT1(s,x) __OUT2(s,s1,"w"); } \ 73__OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
64__OUT1(s##_p,x) __OUT2(s,s1,"w"); slow_down_io(); } 74__OUT1(s##_p, x) __OUT2(s, s1, "w") : : "a" (value), "Nd" (port)); \
75 slow_down_io(); }
65 76
66#define __IN1(s) \ 77#define __IN1(s) \
67static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; 78static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
68 79
69#define __IN2(s,s1,s2) \ 80#define __IN2(s,s1,s2) \
70__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" : "=a" (_v) : "Nd" (port)) 81__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
82
83#define __IN(s,s1,i...) \
84__IN1(s) __IN2(s, s1, "w") : "=a" (_v) : "Nd" (port), ##i); return _v; } \
85__IN1(s##_p) __IN2(s, s1, "w") : "=a" (_v) : "Nd" (port), ##i); \
86 slow_down_io(); return _v; }
71 87
72#define __IN(s,s1) \ 88#ifdef UNSET_REALLY_SLOW_IO
73__IN1(s) __IN2(s,s1,"w"); return _v; } \ 89#undef REALLY_SLOW_IO
74__IN1(s##_p) __IN2(s,s1,"w"); slow_down_io(); return _v; } 90#endif
75 91
76#define __INS(s) \ 92#define __INS(s) \
77static inline void ins##s(unsigned short port, void * addr, unsigned long count) \ 93static inline void ins##s(unsigned short port, void * addr, unsigned long count) \