diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-15 12:19:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-15 12:19:40 -0400 |
commit | 024b246ed24492d6c2ee14c34d742b137fce1b94 (patch) | |
tree | 428444950025503218c96b03c86f749403626dec /arch/alpha/include/asm/io_trivial.h | |
parent | 9419fc1c957d600093baaea247fef23cca3b4e93 (diff) |
alpha: move include/asm-alpha to arch/alpha/include/asm
Sam Ravnborg did the build-test that the direct header file move works,
I'm just committing it.
This is a pure move:
mkdir arch/alpha/include
git mv include/asm-alpha arch/alpha/include/asm
with no other changes.
Requested-and-tested-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha/include/asm/io_trivial.h')
-rw-r--r-- | arch/alpha/include/asm/io_trivial.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/io_trivial.h b/arch/alpha/include/asm/io_trivial.h new file mode 100644 index 000000000000..1c77f10b4b36 --- /dev/null +++ b/arch/alpha/include/asm/io_trivial.h | |||
@@ -0,0 +1,131 @@ | |||
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 | void __iomem *addr = (void __iomem *)a; | ||
76 | return IO_CONCAT(__IO_PREFIX,ioread8)(addr); | ||
77 | } | ||
78 | |||
79 | __EXTERN_INLINE u16 | ||
80 | IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a) | ||
81 | { | ||
82 | void __iomem *addr = (void __iomem *)a; | ||
83 | return IO_CONCAT(__IO_PREFIX,ioread16)(addr); | ||
84 | } | ||
85 | |||
86 | __EXTERN_INLINE void | ||
87 | IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a) | ||
88 | { | ||
89 | void __iomem *addr = (void __iomem *)a; | ||
90 | IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr); | ||
91 | } | ||
92 | |||
93 | __EXTERN_INLINE void | ||
94 | IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a) | ||
95 | { | ||
96 | void __iomem *addr = (void __iomem *)a; | ||
97 | IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr); | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | #if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1 | ||
102 | __EXTERN_INLINE u32 | ||
103 | IO_CONCAT(__IO_PREFIX,readl)(const volatile void __iomem *a) | ||
104 | { | ||
105 | return *(const volatile u32 __force *)a; | ||
106 | } | ||
107 | |||
108 | __EXTERN_INLINE u64 | ||
109 | IO_CONCAT(__IO_PREFIX,readq)(const volatile void __iomem *a) | ||
110 | { | ||
111 | return *(const volatile u64 __force *)a; | ||
112 | } | ||
113 | |||
114 | __EXTERN_INLINE void | ||
115 | IO_CONCAT(__IO_PREFIX,writel)(u32 b, volatile void __iomem *a) | ||
116 | { | ||
117 | *(volatile u32 __force *)a = b; | ||
118 | } | ||
119 | |||
120 | __EXTERN_INLINE void | ||
121 | IO_CONCAT(__IO_PREFIX,writeq)(u64 b, volatile void __iomem *a) | ||
122 | { | ||
123 | *(volatile u64 __force *)a = b; | ||
124 | } | ||
125 | #endif | ||
126 | |||
127 | #if IO_CONCAT(__IO_PREFIX,trivial_iounmap) | ||
128 | __EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,iounmap)(volatile void __iomem *a) | ||
129 | { | ||
130 | } | ||
131 | #endif | ||