1
2#ifndef __GENERIC_IO_H
3#define __GENERIC_IO_H
4
5#include <linux/linkage.h>
6#include <asm/byteorder.h>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29extern unsigned int ioread8(void __iomem *);
30extern unsigned int ioread16(void __iomem *);
31extern unsigned int ioread16be(void __iomem *);
32extern unsigned int ioread32(void __iomem *);
33extern unsigned int ioread32be(void __iomem *);
34#ifdef CONFIG_64BIT
35extern u64 ioread64(void __iomem *);
36extern u64 ioread64be(void __iomem *);
37#endif
38
39#ifdef readq
40#define ioread64_lo_hi ioread64_lo_hi
41#define ioread64_hi_lo ioread64_hi_lo
42#define ioread64be_lo_hi ioread64be_lo_hi
43#define ioread64be_hi_lo ioread64be_hi_lo
44extern u64 ioread64_lo_hi(void __iomem *addr);
45extern u64 ioread64_hi_lo(void __iomem *addr);
46extern u64 ioread64be_lo_hi(void __iomem *addr);
47extern u64 ioread64be_hi_lo(void __iomem *addr);
48#endif
49
50extern void iowrite8(u8, void __iomem *);
51extern void iowrite16(u16, void __iomem *);
52extern void iowrite16be(u16, void __iomem *);
53extern void iowrite32(u32, void __iomem *);
54extern void iowrite32be(u32, void __iomem *);
55#ifdef CONFIG_64BIT
56extern void iowrite64(u64, void __iomem *);
57extern void iowrite64be(u64, void __iomem *);
58#endif
59
60#ifdef writeq
61#define iowrite64_lo_hi iowrite64_lo_hi
62#define iowrite64_hi_lo iowrite64_hi_lo
63#define iowrite64be_lo_hi iowrite64be_lo_hi
64#define iowrite64be_hi_lo iowrite64be_hi_lo
65extern void iowrite64_lo_hi(u64 val, void __iomem *addr);
66extern void iowrite64_hi_lo(u64 val, void __iomem *addr);
67extern void iowrite64be_lo_hi(u64 val, void __iomem *addr);
68extern void iowrite64be_hi_lo(u64 val, void __iomem *addr);
69#endif
70
71
72
73
74
75
76
77
78
79
80
81
82extern void ioread8_rep(void __iomem *port, void *buf, unsigned long count);
83extern void ioread16_rep(void __iomem *port, void *buf, unsigned long count);
84extern void ioread32_rep(void __iomem *port, void *buf, unsigned long count);
85
86extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count);
87extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
88extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
89
90#ifdef CONFIG_HAS_IOPORT_MAP
91
92extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
93extern void ioport_unmap(void __iomem *);
94#endif
95
96#ifndef ARCH_HAS_IOREMAP_WC
97#define ioremap_wc ioremap_nocache
98#endif
99
100#ifndef ARCH_HAS_IOREMAP_WT
101#define ioremap_wt ioremap_nocache
102#endif
103
104#ifdef CONFIG_PCI
105
106struct pci_dev;
107extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
108#elif defined(CONFIG_GENERIC_IOMAP)
109struct pci_dev;
110static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
111{ }
112#endif
113
114#include <asm-generic/pci_iomap.h>
115
116#endif
117