diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /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.h | 127 |
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 | ||
9 | IO_CONCAT(__IO_PREFIX,ioread8)(void __iomem *a) | ||
10 | { | ||
11 | return __kernel_ldbu(*(volatile u8 __force *)a); | ||
12 | } | ||
13 | |||
14 | __EXTERN_INLINE unsigned int | ||
15 | IO_CONCAT(__IO_PREFIX,ioread16)(void __iomem *a) | ||
16 | { | ||
17 | return __kernel_ldwu(*(volatile u16 __force *)a); | ||
18 | } | ||
19 | |||
20 | __EXTERN_INLINE void | ||
21 | IO_CONCAT(__IO_PREFIX,iowrite8)(u8 b, void __iomem *a) | ||
22 | { | ||
23 | __kernel_stb(b, *(volatile u8 __force *)a); | ||
24 | } | ||
25 | |||
26 | __EXTERN_INLINE void | ||
27 | IO_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 | ||
35 | IO_CONCAT(__IO_PREFIX,ioread32)(void __iomem *a) | ||
36 | { | ||
37 | return *(volatile u32 __force *)a; | ||
38 | } | ||
39 | |||
40 | __EXTERN_INLINE void | ||
41 | IO_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 | ||
49 | IO_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 | ||
55 | IO_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 | ||
61 | IO_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 | ||
67 | IO_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 | ||
73 | IO_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 | ||
79 | IO_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 | ||
85 | IO_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 | ||
91 | IO_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 | ||
99 | IO_CONCAT(__IO_PREFIX,readl)(const volatile void __iomem *a) | ||
100 | { | ||
101 | return *(const volatile u32 __force *)a; | ||
102 | } | ||
103 | |||
104 | __EXTERN_INLINE u64 | ||
105 | IO_CONCAT(__IO_PREFIX,readq)(const volatile void __iomem *a) | ||
106 | { | ||
107 | return *(const volatile u64 __force *)a; | ||
108 | } | ||
109 | |||
110 | __EXTERN_INLINE void | ||
111 | IO_CONCAT(__IO_PREFIX,writel)(u32 b, volatile void __iomem *a) | ||
112 | { | ||
113 | *(volatile u32 __force *)a = b; | ||
114 | } | ||
115 | |||
116 | __EXTERN_INLINE void | ||
117 | IO_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 | ||