diff options
Diffstat (limited to 'drivers/s390/cio/ioasm.h')
-rw-r--r-- | drivers/s390/cio/ioasm.h | 86 |
1 files changed, 61 insertions, 25 deletions
diff --git a/drivers/s390/cio/ioasm.h b/drivers/s390/cio/ioasm.h index 45480a2bc4c0..95a9462f9a91 100644 --- a/drivers/s390/cio/ioasm.h +++ b/drivers/s390/cio/ioasm.h | |||
@@ -1,12 +1,13 @@ | |||
1 | #ifndef S390_CIO_IOASM_H | 1 | #ifndef S390_CIO_IOASM_H |
2 | #define S390_CIO_IOASM_H | 2 | #define S390_CIO_IOASM_H |
3 | 3 | ||
4 | #include "schid.h" | ||
5 | |||
4 | /* | 6 | /* |
5 | * TPI info structure | 7 | * TPI info structure |
6 | */ | 8 | */ |
7 | struct tpi_info { | 9 | struct tpi_info { |
8 | __u32 reserved1 : 16; /* reserved 0x00000001 */ | 10 | struct subchannel_id schid; |
9 | __u32 irq : 16; /* aka. subchannel number */ | ||
10 | __u32 intparm; /* interruption parameter */ | 11 | __u32 intparm; /* interruption parameter */ |
11 | __u32 adapter_IO : 1; | 12 | __u32 adapter_IO : 1; |
12 | __u32 reserved2 : 1; | 13 | __u32 reserved2 : 1; |
@@ -21,7 +22,8 @@ struct tpi_info { | |||
21 | * Some S390 specific IO instructions as inline | 22 | * Some S390 specific IO instructions as inline |
22 | */ | 23 | */ |
23 | 24 | ||
24 | static inline int stsch(int irq, volatile struct schib *addr) | 25 | static inline int stsch(struct subchannel_id schid, |
26 | volatile struct schib *addr) | ||
25 | { | 27 | { |
26 | int ccode; | 28 | int ccode; |
27 | 29 | ||
@@ -31,12 +33,42 @@ static inline int stsch(int irq, volatile struct schib *addr) | |||
31 | " ipm %0\n" | 33 | " ipm %0\n" |
32 | " srl %0,28" | 34 | " srl %0,28" |
33 | : "=d" (ccode) | 35 | : "=d" (ccode) |
34 | : "d" (irq | 0x10000), "a" (addr) | 36 | : "d" (schid), "a" (addr), "m" (*addr) |
37 | : "cc", "1" ); | ||
38 | return ccode; | ||
39 | } | ||
40 | |||
41 | static inline int stsch_err(struct subchannel_id schid, | ||
42 | volatile struct schib *addr) | ||
43 | { | ||
44 | int ccode; | ||
45 | |||
46 | __asm__ __volatile__( | ||
47 | " lhi %0,%3\n" | ||
48 | " lr 1,%1\n" | ||
49 | " stsch 0(%2)\n" | ||
50 | "0: ipm %0\n" | ||
51 | " srl %0,28\n" | ||
52 | "1:\n" | ||
53 | #ifdef CONFIG_64BIT | ||
54 | ".section __ex_table,\"a\"\n" | ||
55 | " .align 8\n" | ||
56 | " .quad 0b,1b\n" | ||
57 | ".previous" | ||
58 | #else | ||
59 | ".section __ex_table,\"a\"\n" | ||
60 | " .align 4\n" | ||
61 | " .long 0b,1b\n" | ||
62 | ".previous" | ||
63 | #endif | ||
64 | : "=&d" (ccode) | ||
65 | : "d" (schid), "a" (addr), "K" (-EIO), "m" (*addr) | ||
35 | : "cc", "1" ); | 66 | : "cc", "1" ); |
36 | return ccode; | 67 | return ccode; |
37 | } | 68 | } |
38 | 69 | ||
39 | static inline int msch(int irq, volatile struct schib *addr) | 70 | static inline int msch(struct subchannel_id schid, |
71 | volatile struct schib *addr) | ||
40 | { | 72 | { |
41 | int ccode; | 73 | int ccode; |
42 | 74 | ||
@@ -46,12 +78,13 @@ static inline int msch(int irq, volatile struct schib *addr) | |||
46 | " ipm %0\n" | 78 | " ipm %0\n" |
47 | " srl %0,28" | 79 | " srl %0,28" |
48 | : "=d" (ccode) | 80 | : "=d" (ccode) |
49 | : "d" (irq | 0x10000L), "a" (addr) | 81 | : "d" (schid), "a" (addr), "m" (*addr) |
50 | : "cc", "1" ); | 82 | : "cc", "1" ); |
51 | return ccode; | 83 | return ccode; |
52 | } | 84 | } |
53 | 85 | ||
54 | static inline int msch_err(int irq, volatile struct schib *addr) | 86 | static inline int msch_err(struct subchannel_id schid, |
87 | volatile struct schib *addr) | ||
55 | { | 88 | { |
56 | int ccode; | 89 | int ccode; |
57 | 90 | ||
@@ -62,7 +95,7 @@ static inline int msch_err(int irq, volatile struct schib *addr) | |||
62 | "0: ipm %0\n" | 95 | "0: ipm %0\n" |
63 | " srl %0,28\n" | 96 | " srl %0,28\n" |
64 | "1:\n" | 97 | "1:\n" |
65 | #ifdef CONFIG_ARCH_S390X | 98 | #ifdef CONFIG_64BIT |
66 | ".section __ex_table,\"a\"\n" | 99 | ".section __ex_table,\"a\"\n" |
67 | " .align 8\n" | 100 | " .align 8\n" |
68 | " .quad 0b,1b\n" | 101 | " .quad 0b,1b\n" |
@@ -74,12 +107,13 @@ static inline int msch_err(int irq, volatile struct schib *addr) | |||
74 | ".previous" | 107 | ".previous" |
75 | #endif | 108 | #endif |
76 | : "=&d" (ccode) | 109 | : "=&d" (ccode) |
77 | : "d" (irq | 0x10000L), "a" (addr), "K" (-EIO) | 110 | : "d" (schid), "a" (addr), "K" (-EIO), "m" (*addr) |
78 | : "cc", "1" ); | 111 | : "cc", "1" ); |
79 | return ccode; | 112 | return ccode; |
80 | } | 113 | } |
81 | 114 | ||
82 | static inline int tsch(int irq, volatile struct irb *addr) | 115 | static inline int tsch(struct subchannel_id schid, |
116 | volatile struct irb *addr) | ||
83 | { | 117 | { |
84 | int ccode; | 118 | int ccode; |
85 | 119 | ||
@@ -89,7 +123,7 @@ static inline int tsch(int irq, volatile struct irb *addr) | |||
89 | " ipm %0\n" | 123 | " ipm %0\n" |
90 | " srl %0,28" | 124 | " srl %0,28" |
91 | : "=d" (ccode) | 125 | : "=d" (ccode) |
92 | : "d" (irq | 0x10000L), "a" (addr) | 126 | : "d" (schid), "a" (addr), "m" (*addr) |
93 | : "cc", "1" ); | 127 | : "cc", "1" ); |
94 | return ccode; | 128 | return ccode; |
95 | } | 129 | } |
@@ -103,12 +137,13 @@ static inline int tpi( volatile struct tpi_info *addr) | |||
103 | " ipm %0\n" | 137 | " ipm %0\n" |
104 | " srl %0,28" | 138 | " srl %0,28" |
105 | : "=d" (ccode) | 139 | : "=d" (ccode) |
106 | : "a" (addr) | 140 | : "a" (addr), "m" (*addr) |
107 | : "cc", "1" ); | 141 | : "cc", "1" ); |
108 | return ccode; | 142 | return ccode; |
109 | } | 143 | } |
110 | 144 | ||
111 | static inline int ssch(int irq, volatile struct orb *addr) | 145 | static inline int ssch(struct subchannel_id schid, |
146 | volatile struct orb *addr) | ||
112 | { | 147 | { |
113 | int ccode; | 148 | int ccode; |
114 | 149 | ||
@@ -118,12 +153,12 @@ static inline int ssch(int irq, volatile struct orb *addr) | |||
118 | " ipm %0\n" | 153 | " ipm %0\n" |
119 | " srl %0,28" | 154 | " srl %0,28" |
120 | : "=d" (ccode) | 155 | : "=d" (ccode) |
121 | : "d" (irq | 0x10000L), "a" (addr) | 156 | : "d" (schid), "a" (addr), "m" (*addr) |
122 | : "cc", "1" ); | 157 | : "cc", "1" ); |
123 | return ccode; | 158 | return ccode; |
124 | } | 159 | } |
125 | 160 | ||
126 | static inline int rsch(int irq) | 161 | static inline int rsch(struct subchannel_id schid) |
127 | { | 162 | { |
128 | int ccode; | 163 | int ccode; |
129 | 164 | ||
@@ -133,12 +168,12 @@ static inline int rsch(int irq) | |||
133 | " ipm %0\n" | 168 | " ipm %0\n" |
134 | " srl %0,28" | 169 | " srl %0,28" |
135 | : "=d" (ccode) | 170 | : "=d" (ccode) |
136 | : "d" (irq | 0x10000L) | 171 | : "d" (schid) |
137 | : "cc", "1" ); | 172 | : "cc", "1" ); |
138 | return ccode; | 173 | return ccode; |
139 | } | 174 | } |
140 | 175 | ||
141 | static inline int csch(int irq) | 176 | static inline int csch(struct subchannel_id schid) |
142 | { | 177 | { |
143 | int ccode; | 178 | int ccode; |
144 | 179 | ||
@@ -148,12 +183,12 @@ static inline int csch(int irq) | |||
148 | " ipm %0\n" | 183 | " ipm %0\n" |
149 | " srl %0,28" | 184 | " srl %0,28" |
150 | : "=d" (ccode) | 185 | : "=d" (ccode) |
151 | : "d" (irq | 0x10000L) | 186 | : "d" (schid) |
152 | : "cc", "1" ); | 187 | : "cc", "1" ); |
153 | return ccode; | 188 | return ccode; |
154 | } | 189 | } |
155 | 190 | ||
156 | static inline int hsch(int irq) | 191 | static inline int hsch(struct subchannel_id schid) |
157 | { | 192 | { |
158 | int ccode; | 193 | int ccode; |
159 | 194 | ||
@@ -163,12 +198,12 @@ static inline int hsch(int irq) | |||
163 | " ipm %0\n" | 198 | " ipm %0\n" |
164 | " srl %0,28" | 199 | " srl %0,28" |
165 | : "=d" (ccode) | 200 | : "=d" (ccode) |
166 | : "d" (irq | 0x10000L) | 201 | : "d" (schid) |
167 | : "cc", "1" ); | 202 | : "cc", "1" ); |
168 | return ccode; | 203 | return ccode; |
169 | } | 204 | } |
170 | 205 | ||
171 | static inline int xsch(int irq) | 206 | static inline int xsch(struct subchannel_id schid) |
172 | { | 207 | { |
173 | int ccode; | 208 | int ccode; |
174 | 209 | ||
@@ -178,21 +213,22 @@ static inline int xsch(int irq) | |||
178 | " ipm %0\n" | 213 | " ipm %0\n" |
179 | " srl %0,28" | 214 | " srl %0,28" |
180 | : "=d" (ccode) | 215 | : "=d" (ccode) |
181 | : "d" (irq | 0x10000L) | 216 | : "d" (schid) |
182 | : "cc", "1" ); | 217 | : "cc", "1" ); |
183 | return ccode; | 218 | return ccode; |
184 | } | 219 | } |
185 | 220 | ||
186 | static inline int chsc(void *chsc_area) | 221 | static inline int chsc(void *chsc_area) |
187 | { | 222 | { |
223 | typedef struct { char _[4096]; } addr_type; | ||
188 | int cc; | 224 | int cc; |
189 | 225 | ||
190 | __asm__ __volatile__ ( | 226 | __asm__ __volatile__ ( |
191 | ".insn rre,0xb25f0000,%1,0 \n\t" | 227 | ".insn rre,0xb25f0000,%2,0 \n\t" |
192 | "ipm %0 \n\t" | 228 | "ipm %0 \n\t" |
193 | "srl %0,28 \n\t" | 229 | "srl %0,28 \n\t" |
194 | : "=d" (cc) | 230 | : "=d" (cc), "=m" (*(addr_type *) chsc_area) |
195 | : "d" (chsc_area) | 231 | : "d" (chsc_area), "m" (*(addr_type *) chsc_area) |
196 | : "cc" ); | 232 | : "cc" ); |
197 | 233 | ||
198 | return cc; | 234 | return cc; |