aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/io_64.h
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2010-02-05 09:37:09 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-05 16:57:40 -0500
commit1c5b9069e12e20d2fe883076ae0bf73966492108 (patch)
treeb45f5db29d8c98c0a9123845971d58febd291949 /arch/x86/include/asm/io_64.h
parent910bf6ad0be3e1efbda0e9d358794937b52c9860 (diff)
x86: Merge io.h
io_32.h and io_64.h are now identical. Merge them into io.h. Signed-off-by: Brian Gerst <brgerst@gmail.com> LKML-Reference: <1265380629-3212-8-git-send-email-brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include/asm/io_64.h')
-rw-r--r--arch/x86/include/asm/io_64.h161
1 files changed, 0 insertions, 161 deletions
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h
deleted file mode 100644
index 6964a1c366d3..000000000000
--- a/arch/x86/include/asm/io_64.h
+++ /dev/null
@@ -1,161 +0,0 @@
1#ifndef _ASM_X86_IO_64_H
2#define _ASM_X86_IO_64_H
3
4#include <linux/string.h>
5#include <linux/compiler.h>
6
7/*
8 * This file contains the definitions for the x86 IO instructions
9 * inb/inw/inl/outb/outw/outl and the "string versions" of the same
10 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
11 * versions of the single-IO instructions (inb_p/inw_p/..).
12 *
13 * This file is not meant to be obfuscating: it's just complicated
14 * to (a) handle it all in a way that makes gcc able to optimize it
15 * as well as possible and (b) trying to avoid writing the same thing
16 * over and over again with slight variations and possibly making a
17 * mistake somewhere.
18 */
19
20/*
21 * Thanks to James van Artsdalen for a better timing-fix than
22 * the two short jumps: using outb's to a nonexistent port seems
23 * to guarantee better timings even on fast machines.
24 *
25 * On the other hand, I'd like to be sure of a non-existent port:
26 * I feel a bit unsafe about using 0x80 (should be safe, though)
27 *
28 * Linus
29 */
30
31 /*
32 * Bit simplified and optimized by Jan Hubicka
33 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
34 *
35 * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added,
36 * isa_read[wl] and isa_write[wl] fixed
37 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
38 */
39
40#ifdef __KERNEL__
41
42#include <asm-generic/iomap.h>
43
44#include <linux/vmalloc.h>
45
46/*
47 * Convert a virtual cached pointer to an uncached pointer
48 */
49#define xlate_dev_kmem_ptr(p) p
50
51static inline void
52memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
53{
54 memset((void __force *)addr, val, count);
55}
56
57static inline void
58memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
59{
60 memcpy(dst, (const void __force *)src, count);
61}
62
63static inline void
64memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
65{
66 memcpy((void __force *)dst, src, count);
67}
68
69/*
70 * ISA space is 'always mapped' on a typical x86 system, no need to
71 * explicitly ioremap() it. The fact that the ISA IO space is mapped
72 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
73 * are physical addresses. The following constant pointer can be
74 * used as the IO-area pointer (it can be iounmapped as well, so the
75 * analogy with PCI is quite large):
76 */
77#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
78
79/*
80 * Cache management
81 *
82 * This needed for two cases
83 * 1. Out of order aware processors
84 * 2. Accidentally out of order processors (PPro errata #51)
85 */
86
87static inline void flush_write_buffers(void)
88{
89#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
90 asm volatile("lock; addl $0,0(%%esp)": : :"memory");
91#endif
92}
93
94#endif /* __KERNEL__ */
95
96extern void native_io_delay(void);
97
98extern int io_delay_type;
99extern void io_delay_init(void);
100
101#if defined(CONFIG_PARAVIRT)
102#include <asm/paravirt.h>
103#else
104
105static inline void slow_down_io(void)
106{
107 native_io_delay();
108#ifdef REALLY_SLOW_IO
109 native_io_delay();
110 native_io_delay();
111 native_io_delay();
112#endif
113}
114
115#endif
116
117#define BUILDIO(bwl, bw, type) \
118static inline void out##bwl(unsigned type value, int port) \
119{ \
120 asm volatile("out" #bwl " %" #bw "0, %w1" \
121 : : "a"(value), "Nd"(port)); \
122} \
123 \
124static inline unsigned type in##bwl(int port) \
125{ \
126 unsigned type value; \
127 asm volatile("in" #bwl " %w1, %" #bw "0" \
128 : "=a"(value) : "Nd"(port)); \
129 return value; \
130} \
131 \
132static inline void out##bwl##_p(unsigned type value, int port) \
133{ \
134 out##bwl(value, port); \
135 slow_down_io(); \
136} \
137 \
138static inline unsigned type in##bwl##_p(int port) \
139{ \
140 unsigned type value = in##bwl(port); \
141 slow_down_io(); \
142 return value; \
143} \
144 \
145static inline void outs##bwl(int port, const void *addr, unsigned long count) \
146{ \
147 asm volatile("rep; outs" #bwl \
148 : "+S"(addr), "+c"(count) : "d"(port)); \
149} \
150 \
151static inline void ins##bwl(int port, void *addr, unsigned long count) \
152{ \
153 asm volatile("rep; ins" #bwl \
154 : "+D"(addr), "+c"(count) : "d"(port)); \
155}
156
157BUILDIO(b, b, char)
158BUILDIO(w, w, short)
159BUILDIO(l, , int)
160
161#endif /* _ASM_X86_IO_64_H */