1313#define _ASM_IO_H
1414
1515#include <linux/compiler.h>
16- #include <linux/kernel.h>
1716#include <linux/types.h>
1817#include <linux/irqflags.h>
1918
2524#include <asm/cpu-features.h>
2625#include <asm/page.h>
2726#include <asm/pgtable-bits.h>
28- #include <asm/processor.h>
2927#include <asm/string.h>
3028#include <mangle-port.h>
3129
4139# define __raw_ioswabq (a , x ) (x)
4240# define ____raw_ioswabq (a , x ) (x)
4341
42+ # define _ioswabb ioswabb
43+ # define _ioswabw ioswabw
44+ # define _ioswabl ioswabl
45+ # define _ioswabq ioswabq
46+
4447# define __relaxed_ioswabb ioswabb
4548# define __relaxed_ioswabw ioswabw
4649# define __relaxed_ioswabl ioswabl
@@ -114,23 +117,6 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)
114117 return __virt_to_phys (x );
115118}
116119
117- /*
118- * phys_to_virt - map physical address to virtual
119- * @address: address to remap
120- *
121- * The returned virtual address is a current CPU mapping for
122- * the memory address given. It is only valid to use this function on
123- * addresses that have a kernel mapping
124- *
125- * This function does not handle bus mappings for DMA transfers. In
126- * almost all conceivable cases a device driver should not be using
127- * this function
128- */
129- static inline void * phys_to_virt (unsigned long address )
130- {
131- return __va (address );
132- }
133-
134120/*
135121 * ISA I/O bus memory addresses are 1:1 with the physical address.
136122 */
@@ -139,11 +125,6 @@ static inline unsigned long isa_virt_to_bus(volatile void *address)
139125 return virt_to_phys (address );
140126}
141127
142- static inline void * isa_bus_to_virt (unsigned long address )
143- {
144- return phys_to_virt (address );
145- }
146-
147128/*
148129 * Change "struct page" to physical address.
149130 */
@@ -166,7 +147,6 @@ void iounmap(const volatile void __iomem *addr);
166147 */
167148#define ioremap (offset , size ) \
168149 ioremap_prot((offset), (size), _CACHE_UNCACHED)
169- #define ioremap_uc ioremap
170150
171151/*
172152 * ioremap_cache - map bus memory into CPU space
@@ -296,9 +276,9 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
296276 return pfx ##ioswab ##bwlq(__mem, __val); \
297277}
298278
299- #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax , p ) \
279+ #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax ) \
300280 \
301- static inline void pfx##out##bwlq##p (type val, unsigned long port) \
281+ static inline void pfx##out##bwlq(type val, unsigned long port) \
302282{ \
303283 volatile type *__addr; \
304284 type __val; \
@@ -318,7 +298,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
318298 * __addr = __val ; \
319299} \
320300 \
321- static inline type pfx ##in ##bwlq##p (unsigned long port) \
301+ static inline type pfx ##in ##bwlq(unsigned long port) \
322302{ \
323303 volatile type *__addr; \
324304 type __val; \
@@ -360,11 +340,10 @@ __BUILD_MEMORY_PFX(__mem_, q, u64, 0)
360340#endif
361341
362342#define __BUILD_IOPORT_PFX (bus , bwlq , type ) \
363- __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0,) \
364- __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0, _p)
343+ __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0)
365344
366345#define BUILDIO_IOPORT (bwlq , type ) \
367- __BUILD_IOPORT_PFX(, bwlq, type) \
346+ __BUILD_IOPORT_PFX(_ , bwlq, type) \
368347 __BUILD_IOPORT_PFX(__mem_, bwlq, type)
369348
370349BUILDIO_IOPORT (b , u8 )
@@ -412,14 +391,6 @@ __BUILDIO(q, u64)
412391#define writeq_be (val , addr ) \
413392 __raw_writeq(cpu_to_be64((val)), (__force unsigned *)(addr))
414393
415- /*
416- * Some code tests for these symbols
417- */
418- #ifdef CONFIG_64BIT
419- #define readq readq
420- #define writeq writeq
421- #endif
422-
423394#define __BUILD_MEMORY_STRING (bwlq , type ) \
424395 \
425396static inline void writes##bwlq(volatile void __iomem *mem, \
@@ -480,18 +451,6 @@ BUILDSTRING(l, u32)
480451BUILDSTRING (q , u64 )
481452#endif
482453
483- static inline void memset_io (volatile void __iomem * addr , unsigned char val , int count )
484- {
485- memset ((void __force * ) addr , val , count );
486- }
487- static inline void memcpy_fromio (void * dst , const volatile void __iomem * src , int count )
488- {
489- memcpy (dst , (void __force * ) src , count );
490- }
491- static inline void memcpy_toio (volatile void __iomem * dst , const void * src , int count )
492- {
493- memcpy ((void __force * ) dst , src , count );
494- }
495454
496455/*
497456 * The caches on some architectures aren't dma-coherent and have need to
@@ -548,13 +507,66 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
548507#define csr_out32 (v , a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
549508#define csr_in32 (a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
550509
551- /*
552- * Convert a physical pointer to a virtual kernel pointer for /dev/mem
553- * access
554- */
555- #define xlate_dev_mem_ptr (p ) __va(p)
556- #define unxlate_dev_mem_ptr (p , v ) do { } while (0)
510+ #define __raw_readb __raw_readb
511+ #define __raw_readw __raw_readw
512+ #define __raw_readl __raw_readl
513+ #ifdef CONFIG_64BIT
514+ #define __raw_readq __raw_readq
515+ #endif
516+ #define __raw_writeb __raw_writeb
517+ #define __raw_writew __raw_writew
518+ #define __raw_writel __raw_writel
519+ #ifdef CONFIG_64BIT
520+ #define __raw_writeq __raw_writeq
521+ #endif
522+
523+ #define readb readb
524+ #define readw readw
525+ #define readl readl
526+ #ifdef CONFIG_64BIT
527+ #define readq readq
528+ #endif
529+ #define writeb writeb
530+ #define writew writew
531+ #define writel writel
532+ #ifdef CONFIG_64BIT
533+ #define writeq writeq
534+ #endif
535+
536+ #define readsb readsb
537+ #define readsw readsw
538+ #define readsl readsl
539+ #ifdef CONFIG_64BIT
540+ #define readsq readsq
541+ #endif
542+ #define writesb writesb
543+ #define writesw writesw
544+ #define writesl writesl
545+ #ifdef CONFIG_64BIT
546+ #define writesq writesq
547+ #endif
548+
549+ #define _inb _inb
550+ #define _inw _inw
551+ #define _inl _inl
552+ #define insb insb
553+ #define insw insw
554+ #define insl insl
555+
556+ #define _outb _outb
557+ #define _outw _outw
558+ #define _outl _outl
559+ #define outsb outsb
560+ #define outsw outsw
561+ #define outsl outsl
557562
558563void __ioread64_copy (void * to , const void __iomem * from , size_t count );
559564
565+ #include <asm-generic/io.h>
566+
567+ static inline void * isa_bus_to_virt (unsigned long address )
568+ {
569+ return phys_to_virt (address );
570+ }
571+
560572#endif /* _ASM_IO_H */
0 commit comments