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
@@ -126,6 +129,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)
126129 * almost all conceivable cases a device driver should not be using
127130 * this function
128131 */
132+ #define phys_to_virt phys_to_virt
129133static inline void * phys_to_virt (unsigned long address )
130134{
131135 return __va (address );
@@ -296,9 +300,9 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
296300 return pfx ##ioswab ##bwlq(__mem, __val); \
297301}
298302
299- #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax , p ) \
303+ #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax ) \
300304 \
301- static inline void pfx##out##bwlq##p (type val, unsigned long port) \
305+ static inline void pfx##out##bwlq(type val, unsigned long port) \
302306{ \
303307 volatile type *__addr; \
304308 type __val; \
@@ -318,7 +322,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
318322 * __addr = __val ; \
319323} \
320324 \
321- static inline type pfx ##in ##bwlq##p (unsigned long port) \
325+ static inline type pfx ##in ##bwlq(unsigned long port) \
322326{ \
323327 volatile type *__addr; \
324328 type __val; \
@@ -360,11 +364,10 @@ __BUILD_MEMORY_PFX(__mem_, q, u64, 0)
360364#endif
361365
362366#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)
367+ __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0)
365368
366369#define BUILDIO_IOPORT (bwlq , type ) \
367- __BUILD_IOPORT_PFX(, bwlq, type) \
370+ __BUILD_IOPORT_PFX(_ , bwlq, type) \
368371 __BUILD_IOPORT_PFX(__mem_, bwlq, type)
369372
370373BUILDIO_IOPORT (b , u8 )
@@ -412,14 +415,6 @@ __BUILDIO(q, u64)
412415#define writeq_be (val , addr ) \
413416 __raw_writeq(cpu_to_be64((val)), (__force unsigned *)(addr))
414417
415- /*
416- * Some code tests for these symbols
417- */
418- #ifdef CONFIG_64BIT
419- #define readq readq
420- #define writeq writeq
421- #endif
422-
423418#define __BUILD_MEMORY_STRING (bwlq , type ) \
424419 \
425420static inline void writes##bwlq(volatile void __iomem *mem, \
@@ -480,18 +475,6 @@ BUILDSTRING(l, u32)
480475BUILDSTRING (q , u64 )
481476#endif
482477
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- }
495478
496479/*
497480 * The caches on some architectures aren't dma-coherent and have need to
@@ -548,6 +531,61 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
548531#define csr_out32 (v , a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
549532#define csr_in32 (a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
550533
534+
535+ #define __raw_readb __raw_readb
536+ #define __raw_readw __raw_readw
537+ #define __raw_readl __raw_readl
538+ #ifdef CONFIG_64BIT
539+ #define __raw_readq __raw_readq
540+ #endif
541+ #define __raw_writeb __raw_writeb
542+ #define __raw_writew __raw_writew
543+ #define __raw_writel __raw_writel
544+ #ifdef CONFIG_64BIT
545+ #define __raw_writeq __raw_writeq
546+ #endif
547+
548+ #define readb readb
549+ #define readw readw
550+ #define readl readl
551+ #ifdef CONFIG_64BIT
552+ #define readq readq
553+ #endif
554+ #define writeb writeb
555+ #define writew writew
556+ #define writel writel
557+ #ifdef CONFIG_64BIT
558+ #define writeq writeq
559+ #endif
560+
561+ #define readsb readsb
562+ #define readsw readsw
563+ #define readsl readsl
564+ #ifdef CONFIG_64BIT
565+ #define readsq readsq
566+ #endif
567+ #define writesb writesb
568+ #define writesw writesw
569+ #define writesl writesl
570+ #ifdef CONFIG_64BIT
571+ #define writesq writesq
572+ #endif
573+
574+ #define _inb _inb
575+ #define _inw _inw
576+ #define _inl _inl
577+ #define insb insb
578+ #define insw insw
579+ #define insl insl
580+
581+ #define _outb _outb
582+ #define _outw _outw
583+ #define _outl _outl
584+ #define outsb outsb
585+ #define outsw outsw
586+ #define outsl outsl
587+
588+
551589/*
552590 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
553591 * access
@@ -557,4 +595,6 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
557595
558596void __ioread64_copy (void * to , const void __iomem * from , size_t count );
559597
598+ #include <asm-generic/io.h>
599+
560600#endif /* _ASM_IO_H */
0 commit comments