aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/io_64.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 16:29:44 -0500
committerJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 16:29:44 -0500
commit976e8f677e42757e5586ea04a9ac8bb8ddaa037e (patch)
treeaddb2267fe1267f506117dac15e0bc1843bf72fe /arch/x86/include/asm/io_64.h
parent26c8e3179933c5c9071b16db76ab6de58a787d06 (diff)
x86: asm/io.h: unify virt_to_phys/phys_to_virt
Impact: unify identical code asm/io_32.h and _64.h has functionally identical definitions for virt_to_phys, phys_to_virt, page_to_phys, and the isa_* variants, so just unify them. The only slightly functional change is using phys_addr_t for the physical address argument and return val. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/io_64.h')
-rw-r--r--arch/x86/include/asm/io_64.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h
index 563c16270ba6..e71b55508775 100644
--- a/arch/x86/include/asm/io_64.h
+++ b/arch/x86/include/asm/io_64.h
@@ -142,27 +142,6 @@ __OUTS(l)
142 142
143#include <linux/vmalloc.h> 143#include <linux/vmalloc.h>
144 144
145#ifndef __i386__
146/*
147 * Change virtual addresses to physical addresses and vv.
148 * These are pretty trivial
149 */
150static inline unsigned long virt_to_phys(volatile void *address)
151{
152 return __pa(address);
153}
154
155static inline void *phys_to_virt(unsigned long address)
156{
157 return __va(address);
158}
159#endif
160
161/*
162 * Change "struct page" to physical address.
163 */
164#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
165
166#include <asm-generic/iomap.h> 145#include <asm-generic/iomap.h>
167 146
168/* 147/*
@@ -187,22 +166,6 @@ extern void iounmap(volatile void __iomem *addr);
187 166
188extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); 167extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
189 168
190/*
191 * ISA I/O bus memory addresses are 1:1 with the physical address.
192 */
193#define isa_virt_to_bus virt_to_phys
194#define isa_page_to_bus page_to_phys
195#define isa_bus_to_virt phys_to_virt
196
197/*
198 * However PCI ones are not necessarily 1:1 and therefore these interfaces
199 * are forbidden in portable PCI drivers.
200 *
201 * Allow them on x86 for legacy drivers, though.
202 */
203#define virt_to_bus virt_to_phys
204#define bus_to_virt phys_to_virt
205
206void __memcpy_fromio(void *, unsigned long, unsigned); 169void __memcpy_fromio(void *, unsigned long, unsigned);
207void __memcpy_toio(unsigned long, const void *, unsigned); 170void __memcpy_toio(unsigned long, const void *, unsigned);
208 171