diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:10 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:10 -0500 |
commit | ba082427ae6ffbf8e48a26ae4f72f4501a6b80c1 (patch) | |
tree | 88c48bd8a3be3639a8fa8e0451fb536fde7d2361 | |
parent | ee238e5ca66858f80170f87724f84d67183b069a (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>
-rw-r--r-- | arch/x86/boot/compressed/misc_64.c | 6 | ||||
-rw-r--r-- | include/asm-x86/io_64.h | 30 |
2 files changed, 29 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/misc_64.c b/arch/x86/boot/compressed/misc_64.c index 43e5fcc37be9..7d8338e21b00 100644 --- a/arch/x86/boot/compressed/misc_64.c +++ b/arch/x86/boot/compressed/misc_64.c | |||
@@ -9,6 +9,12 @@ | |||
9 | * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 | 9 | * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | ||
13 | * we have to be careful, because no indirections are allowed here, and | ||
14 | * paravirt_ops is a kind of one. As it will only run in baremetal anyway, | ||
15 | * we just keep it from happening | ||
16 | */ | ||
17 | #undef CONFIG_PARAVIRT | ||
12 | #define _LINUX_STRING_H_ 1 | 18 | #define _LINUX_STRING_H_ 1 |
13 | #define __LINUX_BITMAP_H 1 | 19 | #define __LINUX_BITMAP_H 1 |
14 | 20 | ||
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); | |||
40 | extern int io_delay_type; | 40 | extern int io_delay_type; |
41 | extern void io_delay_init(void); | 41 | extern void io_delay_init(void); |
42 | 42 | ||
43 | #if defined(CONFIG_PARAVIRT) | ||
44 | #include <asm/paravirt.h> | ||
45 | #else | ||
46 | |||
43 | static inline void slow_down_io(void) | 47 | static 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) | |||
57 | static inline void out##s(unsigned x value, unsigned short port) { | 62 | static 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) \ |
67 | static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; | 78 | static 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) \ |
77 | static inline void ins##s(unsigned short port, void * addr, unsigned long count) \ | 93 | static inline void ins##s(unsigned short port, void * addr, unsigned long count) \ |