13
13
#define _ASM_IO_H
14
14
15
15
#include <linux/compiler.h>
16
- #include <linux/kernel.h>
17
16
#include <linux/types.h>
18
17
#include <linux/irqflags.h>
19
18
25
24
#include <asm/cpu-features.h>
26
25
#include <asm/page.h>
27
26
#include <asm/pgtable-bits.h>
28
- #include <asm/processor.h>
29
27
#include <asm/string.h>
30
28
#include <mangle-port.h>
31
29
41
39
# define __raw_ioswabq (a , x ) (x)
42
40
# define ____raw_ioswabq (a , x ) (x)
43
41
42
+ # define _ioswabb ioswabb
43
+ # define _ioswabw ioswabw
44
+ # define _ioswabl ioswabl
45
+ # define _ioswabq ioswabq
46
+
44
47
# define __relaxed_ioswabb ioswabb
45
48
# define __relaxed_ioswabw ioswabw
46
49
# define __relaxed_ioswabl ioswabl
@@ -126,6 +129,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)
126
129
* almost all conceivable cases a device driver should not be using
127
130
* this function
128
131
*/
132
+ #define phys_to_virt phys_to_virt
129
133
static inline void * phys_to_virt (unsigned long address )
130
134
{
131
135
return __va (address );
@@ -296,9 +300,9 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
296
300
return pfx ##ioswab ##bwlq(__mem, __val); \
297
301
}
298
302
299
- #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax , p ) \
303
+ #define __BUILD_IOPORT_SINGLE (pfx , bwlq , type , barrier , relax ) \
300
304
\
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) \
302
306
{ \
303
307
volatile type *__addr; \
304
308
type __val; \
@@ -318,7 +322,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
318
322
* __addr = __val ; \
319
323
} \
320
324
\
321
- static inline type pfx ##in ##bwlq##p (unsigned long port) \
325
+ static inline type pfx ##in ##bwlq(unsigned long port) \
322
326
{ \
323
327
volatile type *__addr; \
324
328
type __val; \
@@ -360,11 +364,10 @@ __BUILD_MEMORY_PFX(__mem_, q, u64, 0)
360
364
#endif
361
365
362
366
#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)
365
368
366
369
#define BUILDIO_IOPORT (bwlq , type ) \
367
- __BUILD_IOPORT_PFX(, bwlq, type) \
370
+ __BUILD_IOPORT_PFX(_ , bwlq, type) \
368
371
__BUILD_IOPORT_PFX(__mem_, bwlq, type)
369
372
370
373
BUILDIO_IOPORT (b , u8 )
@@ -412,14 +415,6 @@ __BUILDIO(q, u64)
412
415
#define writeq_be (val , addr ) \
413
416
__raw_writeq(cpu_to_be64((val)), (__force unsigned *)(addr))
414
417
415
- /*
416
- * Some code tests for these symbols
417
- */
418
- #ifdef CONFIG_64BIT
419
- #define readq readq
420
- #define writeq writeq
421
- #endif
422
-
423
418
#define __BUILD_MEMORY_STRING (bwlq , type ) \
424
419
\
425
420
static inline void writes##bwlq(volatile void __iomem *mem, \
@@ -480,18 +475,6 @@ BUILDSTRING(l, u32)
480
475
BUILDSTRING (q , u64 )
481
476
#endif
482
477
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
- }
495
478
496
479
/*
497
480
* 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);
548
531
#define csr_out32 (v , a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
549
532
#define csr_in32 (a ) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
550
533
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
+
551
589
/*
552
590
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
553
591
* access
@@ -557,4 +595,6 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
557
595
558
596
void __ioread64_copy (void * to , const void __iomem * from , size_t count );
559
597
598
+ #include <asm-generic/io.h>
599
+
560
600
#endif /* _ASM_IO_H */
0 commit comments