aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/misc_64.c6
-rw-r--r--include/asm-x86/io_64.h30
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);
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) \