aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2010-02-05 09:37:05 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-05 16:57:22 -0500
commit2e16fc7728a77755b5b2dc6b27dde62cd97b9ea5 (patch)
tree0fd365142221f1fb688fca890339d31ec5cf6484 /arch
parentbd2984e96452855d148ebce76f696dcecbc96340 (diff)
x86-64: Reorganize io_64.h
Make it more similar to io_32.h. No real code changes. Signed-off-by: Brian Gerst <brgerst@gmail.com> LKML-Reference: <1265380629-3212-4-git-send-email-brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/io_64.h90
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
49void memset_io(volatile void __iomem *a, int b, size_t c);
50
51void __memcpy_fromio(void *, unsigned long, unsigned);
52static 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
58void __memcpy_toio(unsigned long, const void *, unsigned);
59static 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
38extern void native_io_delay(void); 86extern void native_io_delay(void);
39 87
40extern int io_delay_type; 88extern 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
145void __memcpy_fromio(void *, unsigned long, unsigned);
146void __memcpy_toio(unsigned long, const void *, unsigned);
147
148static 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
154static 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
160void 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 */