aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/io_trivial.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-alpha/io_trivial.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-alpha/io_trivial.h')
-rw-r--r--include/asm-alpha/io_trivial.h127
1 files changed, 127 insertions, 0 deletions
diff --git a/include/asm-alpha/io_trivial.h b/include/asm-alpha/io_trivial.h
new file mode 100644
index 000000000000..b10d1aa4cdd1
--- /dev/null
+++ b/include/asm-alpha/io_trivial.h
@@ -0,0 +1,127 @@
1/* Trivial implementations of basic i/o routines. Assumes that all
2 of the hard work has been done by ioremap and ioportmap, and that
3 access to i/o space is linear. */
4
5/* This file may be included multiple times. */
6
7#if IO_CONCAT(__IO_PREFIX,trivial_io_bw)
8__EXTERN_INLINE unsigned int
9IO_CONCAT(__IO_PREFIX,ioread8)(void __iomem *a)
10{
11 return __kernel_ldbu(*(volatile u8 __force *)a);
12}
13
14__EXTERN_INLINE unsigned int
15IO_CONCAT(__IO_PREFIX,ioread16)(void __iomem *a)
16{
17 return __kernel_ldwu(*(volatile u16 __force *)a);
18}
19
20__EXTERN_INLINE void
21IO_CONCAT(__IO_PREFIX,iowrite8)(u8 b, void __iomem *a)
22{
23 __kernel_stb(b, *(volatile u8 __force *)a);
24}
25
26__EXTERN_INLINE void
27IO_CONCAT(__IO_PREFIX,iowrite16)(u16 b, void __iomem *a)
28{
29 __kernel_stw(b, *(volatile u16 __force *)a);
30}
31#endif
32
33#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
34__EXTERN_INLINE unsigned int
35IO_CONCAT(__IO_PREFIX,ioread32)(void __iomem *a)
36{
37 return *(volatile u32 __force *)a;
38}
39
40__EXTERN_INLINE void
41IO_CONCAT(__IO_PREFIX,iowrite32)(u32 b, void __iomem *a)
42{
43 *(volatile u32 __force *)a = b;
44}
45#endif
46
47#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
48__EXTERN_INLINE u8
49IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
50{
51 return __kernel_ldbu(*(const volatile u8 __force *)a);
52}
53
54__EXTERN_INLINE u16
55IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
56{
57 return __kernel_ldwu(*(const volatile u16 __force *)a);
58}
59
60__EXTERN_INLINE void
61IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
62{
63 __kernel_stb(b, *(volatile u8 __force *)a);
64}
65
66__EXTERN_INLINE void
67IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
68{
69 __kernel_stw(b, *(volatile u16 __force *)a);
70}
71#elif IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 2
72__EXTERN_INLINE u8
73IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
74{
75 return IO_CONCAT(__IO_PREFIX,ioread8)((void __iomem *)a);
76}
77
78__EXTERN_INLINE u16
79IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
80{
81 return IO_CONCAT(__IO_PREFIX,ioread16)((void __iomem *)a);
82}
83
84__EXTERN_INLINE void
85IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
86{
87 IO_CONCAT(__IO_PREFIX,iowrite8)(b, (void __iomem *)a);
88}
89
90__EXTERN_INLINE void
91IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
92{
93 IO_CONCAT(__IO_PREFIX,iowrite16)(b, (void __iomem *)a);
94}
95#endif
96
97#if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1
98__EXTERN_INLINE u32
99IO_CONCAT(__IO_PREFIX,readl)(const volatile void __iomem *a)
100{
101 return *(const volatile u32 __force *)a;
102}
103
104__EXTERN_INLINE u64
105IO_CONCAT(__IO_PREFIX,readq)(const volatile void __iomem *a)
106{
107 return *(const volatile u64 __force *)a;
108}
109
110__EXTERN_INLINE void
111IO_CONCAT(__IO_PREFIX,writel)(u32 b, volatile void __iomem *a)
112{
113 *(volatile u32 __force *)a = b;
114}
115
116__EXTERN_INLINE void
117IO_CONCAT(__IO_PREFIX,writeq)(u64 b, volatile void __iomem *a)
118{
119 *(volatile u64 __force *)a = b;
120}
121#endif
122
123#if IO_CONCAT(__IO_PREFIX,trivial_iounmap)
124__EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,iounmap)(volatile void __iomem *a)
125{
126}
127#endif