0001
0002 #ifndef __GENERIC_IO_H
0003 #define __GENERIC_IO_H
0004
0005 #include <linux/linkage.h>
0006 #include <asm/byteorder.h>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 extern unsigned int ioread8(const void __iomem *);
0030 extern unsigned int ioread16(const void __iomem *);
0031 extern unsigned int ioread16be(const void __iomem *);
0032 extern unsigned int ioread32(const void __iomem *);
0033 extern unsigned int ioread32be(const void __iomem *);
0034 #ifdef CONFIG_64BIT
0035 extern u64 ioread64(const void __iomem *);
0036 extern u64 ioread64be(const void __iomem *);
0037 #endif
0038
0039 #ifdef readq
0040 #define ioread64_lo_hi ioread64_lo_hi
0041 #define ioread64_hi_lo ioread64_hi_lo
0042 #define ioread64be_lo_hi ioread64be_lo_hi
0043 #define ioread64be_hi_lo ioread64be_hi_lo
0044 extern u64 ioread64_lo_hi(const void __iomem *addr);
0045 extern u64 ioread64_hi_lo(const void __iomem *addr);
0046 extern u64 ioread64be_lo_hi(const void __iomem *addr);
0047 extern u64 ioread64be_hi_lo(const void __iomem *addr);
0048 #endif
0049
0050 extern void iowrite8(u8, void __iomem *);
0051 extern void iowrite16(u16, void __iomem *);
0052 extern void iowrite16be(u16, void __iomem *);
0053 extern void iowrite32(u32, void __iomem *);
0054 extern void iowrite32be(u32, void __iomem *);
0055 #ifdef CONFIG_64BIT
0056 extern void iowrite64(u64, void __iomem *);
0057 extern void iowrite64be(u64, void __iomem *);
0058 #endif
0059
0060 #ifdef writeq
0061 #define iowrite64_lo_hi iowrite64_lo_hi
0062 #define iowrite64_hi_lo iowrite64_hi_lo
0063 #define iowrite64be_lo_hi iowrite64be_lo_hi
0064 #define iowrite64be_hi_lo iowrite64be_hi_lo
0065 extern void iowrite64_lo_hi(u64 val, void __iomem *addr);
0066 extern void iowrite64_hi_lo(u64 val, void __iomem *addr);
0067 extern void iowrite64be_lo_hi(u64 val, void __iomem *addr);
0068 extern void iowrite64be_hi_lo(u64 val, void __iomem *addr);
0069 #endif
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 extern void ioread8_rep(const void __iomem *port, void *buf, unsigned long count);
0083 extern void ioread16_rep(const void __iomem *port, void *buf, unsigned long count);
0084 extern void ioread32_rep(const void __iomem *port, void *buf, unsigned long count);
0085
0086 extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count);
0087 extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
0088 extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
0089
0090 #ifdef CONFIG_HAS_IOPORT_MAP
0091
0092 extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
0093 extern void ioport_unmap(void __iomem *);
0094 #endif
0095
0096 #ifndef ARCH_HAS_IOREMAP_WC
0097 #define ioremap_wc ioremap
0098 #endif
0099
0100 #ifndef ARCH_HAS_IOREMAP_WT
0101 #define ioremap_wt ioremap
0102 #endif
0103
0104 #ifndef ARCH_HAS_IOREMAP_NP
0105
0106 #define ioremap_np ioremap_np
0107 static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
0108 {
0109 return NULL;
0110 }
0111 #endif
0112
0113 #include <asm-generic/pci_iomap.h>
0114
0115 #endif