diff options
Diffstat (limited to 'arch/x86/include/asm/io_64.h')
-rw-r--r-- | arch/x86/include/asm/io_64.h | 90 |
1 files changed, 49 insertions, 41 deletions
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h index 244067893af4..040bf74d717d 100644 --- a/arch/x86/include/asm/io_64.h +++ b/arch/x86/include/asm/io_64.h | |||
@@ -35,6 +35,54 @@ | |||
35 | * - Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 35 | * - Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #ifdef __KERNEL__ | ||
39 | |||
40 | #include <asm-generic/iomap.h> | ||
41 | |||
42 | #include <linux/vmalloc.h> | ||
43 | |||
44 | /* | ||
45 | * Convert a virtual cached pointer to an uncached pointer | ||
46 | */ | ||
47 | #define xlate_dev_kmem_ptr(p) p | ||
48 | |||
49 | void memset_io(volatile void __iomem *a, int b, size_t c); | ||
50 | |||
51 | void __memcpy_fromio(void *, unsigned long, unsigned); | ||
52 | static inline void memcpy_fromio(void *to, const volatile void __iomem *from, | ||
53 | unsigned len) | ||
54 | { | ||
55 | __memcpy_fromio(to, (unsigned long)from, len); | ||
56 | } | ||
57 | |||
58 | void __memcpy_toio(unsigned long, const void *, unsigned); | ||
59 | static inline void memcpy_toio(volatile void __iomem *to, const void *from, | ||
60 | unsigned len) | ||
61 | { | ||
62 | __memcpy_toio((unsigned long)to, from, len); | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * ISA space is 'always mapped' on a typical x86 system, no need to | ||
67 | * explicitly ioremap() it. The fact that the ISA IO space is mapped | ||
68 | * to PAGE_OFFSET is pure coincidence - it does not mean ISA values | ||
69 | * are physical addresses. The following constant pointer can be | ||
70 | * used as the IO-area pointer (it can be iounmapped as well, so the | ||
71 | * analogy with PCI is quite large): | ||
72 | */ | ||
73 | #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) | ||
74 | |||
75 | /* | ||
76 | * Cache management | ||
77 | * | ||
78 | * This needed for two cases | ||
79 | * 1. Out of order aware processors | ||
80 | * 2. Accidentally out of order processors (PPro errata #51) | ||
81 | */ | ||
82 | #define flush_write_buffers() do { } while (0) | ||
83 | |||
84 | #endif /* __KERNEL__ */ | ||
85 | |||
38 | extern void native_io_delay(void); | 86 | extern void native_io_delay(void); |
39 | 87 | ||
40 | extern int io_delay_type; | 88 | extern int io_delay_type; |
@@ -53,6 +101,7 @@ static inline void slow_down_io(void) | |||
53 | native_io_delay(); | 101 | native_io_delay(); |
54 | #endif | 102 | #endif |
55 | } | 103 | } |
104 | |||
56 | #endif | 105 | #endif |
57 | 106 | ||
58 | /* | 107 | /* |
@@ -136,46 +185,5 @@ __OUTS(b) | |||
136 | __OUTS(w) | 185 | __OUTS(w) |
137 | __OUTS(l) | 186 | __OUTS(l) |
138 | 187 | ||
139 | #if defined(__KERNEL__) && defined(__x86_64__) | ||
140 | |||
141 | #include <linux/vmalloc.h> | ||
142 | |||
143 | #include <asm-generic/iomap.h> | ||
144 | |||
145 | void __memcpy_fromio(void *, unsigned long, unsigned); | ||
146 | void __memcpy_toio(unsigned long, const void *, unsigned); | ||
147 | |||
148 | static inline void memcpy_fromio(void *to, const volatile void __iomem *from, | ||
149 | unsigned len) | ||
150 | { | ||
151 | __memcpy_fromio(to, (unsigned long)from, len); | ||
152 | } | ||
153 | |||
154 | static inline void memcpy_toio(volatile void __iomem *to, const void *from, | ||
155 | unsigned len) | ||
156 | { | ||
157 | __memcpy_toio((unsigned long)to, from, len); | ||
158 | } | ||
159 | |||
160 | void memset_io(volatile void __iomem *a, int b, size_t c); | ||
161 | |||
162 | /* | ||
163 | * ISA space is 'always mapped' on a typical x86 system, no need to | ||
164 | * explicitly ioremap() it. The fact that the ISA IO space is mapped | ||
165 | * to PAGE_OFFSET is pure coincidence - it does not mean ISA values | ||
166 | * are physical addresses. The following constant pointer can be | ||
167 | * used as the IO-area pointer (it can be iounmapped as well, so the | ||
168 | * analogy with PCI is quite large): | ||
169 | */ | ||
170 | #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) | ||
171 | |||
172 | #define flush_write_buffers() | ||
173 | |||
174 | /* | ||
175 | * Convert a virtual cached pointer to an uncached pointer | ||
176 | */ | ||
177 | #define xlate_dev_kmem_ptr(p) p | ||
178 | |||
179 | #endif /* __KERNEL__ */ | ||
180 | 188 | ||
181 | #endif /* _ASM_X86_IO_64_H */ | 189 | #endif /* _ASM_X86_IO_64_H */ |