diff options
author | Peter Oberparleiter <oberpar@linux.vnet.ibm.com> | 2015-12-18 06:59:32 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-12-18 08:59:34 -0500 |
commit | 2ab59de7c5ce7c5ed6db07278554901d43fe80a0 (patch) | |
tree | c5db8208dddcca4e9228f5ec57d6f80cc58b8232 | |
parent | ac357c4105ef6b2d44227aa349850a3c1a2994a5 (diff) |
s390/cio: Consolidate inline assemblies and related data definitions
Replace the current semi-arbitrary distribution of inline assemblies:
- Inline assemblies used by CIO go into ioasm.h
- Data definitions used by inline assemblies go into cio.h
Beyond cleaning up the current structure this is also required for
use of tracepoints in inline assemblies introduced by a follow-on
patch.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/crw.h | 14 | ||||
-rw-r--r-- | drivers/s390/cio/cio.h | 12 | ||||
-rw-r--r-- | drivers/s390/cio/crw.c | 1 | ||||
-rw-r--r-- | drivers/s390/cio/io_sch.h | 45 | ||||
-rw-r--r-- | drivers/s390/cio/ioasm.h | 75 |
5 files changed, 73 insertions, 74 deletions
diff --git a/arch/s390/include/asm/crw.h b/arch/s390/include/asm/crw.h index 7c31d3e25cd1..bcb9cd2a730a 100644 --- a/arch/s390/include/asm/crw.h +++ b/arch/s390/include/asm/crw.h | |||
@@ -52,18 +52,4 @@ void crw_wait_for_channel_report(void); | |||
52 | #define CRW_ERC_PERRI 0x07 /* perm. error, facility init */ | 52 | #define CRW_ERC_PERRI 0x07 /* perm. error, facility init */ |
53 | #define CRW_ERC_PMOD 0x08 /* installed parameters modified */ | 53 | #define CRW_ERC_PMOD 0x08 /* installed parameters modified */ |
54 | 54 | ||
55 | static inline int stcrw(struct crw *pcrw) | ||
56 | { | ||
57 | int ccode; | ||
58 | |||
59 | asm volatile( | ||
60 | " stcrw 0(%2)\n" | ||
61 | " ipm %0\n" | ||
62 | " srl %0,28\n" | ||
63 | : "=d" (ccode), "=m" (*pcrw) | ||
64 | : "a" (pcrw) | ||
65 | : "cc" ); | ||
66 | return ccode; | ||
67 | } | ||
68 | |||
69 | #endif /* _ASM_S390_CRW_H */ | 55 | #endif /* _ASM_S390_CRW_H */ |
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h index a01376ae1749..93de0b46b489 100644 --- a/drivers/s390/cio/cio.h +++ b/drivers/s390/cio/cio.h | |||
@@ -45,6 +45,18 @@ struct pmcw { | |||
45 | /* ... in an operand exception. */ | 45 | /* ... in an operand exception. */ |
46 | } __attribute__ ((packed)); | 46 | } __attribute__ ((packed)); |
47 | 47 | ||
48 | /* I/O-Interruption Code as stored by TEST PENDING INTERRUPTION (TPI). */ | ||
49 | struct tpi_info { | ||
50 | struct subchannel_id schid; | ||
51 | u32 intparm; | ||
52 | u32 adapter_IO:1; | ||
53 | u32 :1; | ||
54 | u32 isc:3; | ||
55 | u32 :27; | ||
56 | u32 type:3; | ||
57 | u32 :12; | ||
58 | } __packed __aligned(4); | ||
59 | |||
48 | /* Target SCHIB configuration. */ | 60 | /* Target SCHIB configuration. */ |
49 | struct schib_config { | 61 | struct schib_config { |
50 | u64 mba; | 62 | u64 mba; |
diff --git a/drivers/s390/cio/crw.c b/drivers/s390/cio/crw.c index 0f8a25f98b10..3d3cd402b376 100644 --- a/drivers/s390/cio/crw.c +++ b/drivers/s390/cio/crw.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
15 | #include <asm/crw.h> | 15 | #include <asm/crw.h> |
16 | #include <asm/ctl_reg.h> | 16 | #include <asm/ctl_reg.h> |
17 | #include "ioasm.h" | ||
17 | 18 | ||
18 | static DEFINE_MUTEX(crw_handler_mutex); | 19 | static DEFINE_MUTEX(crw_handler_mutex); |
19 | static crw_handler_t crw_handlers[NR_RSCS]; | 20 | static crw_handler_t crw_handlers[NR_RSCS]; |
diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index 789ce783d3e1..8975060af96c 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h | |||
@@ -169,49 +169,4 @@ struct ccw_device_private { | |||
169 | enum interruption_class int_class; | 169 | enum interruption_class int_class; |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static inline int rsch(struct subchannel_id schid) | ||
173 | { | ||
174 | register struct subchannel_id reg1 asm("1") = schid; | ||
175 | int ccode; | ||
176 | |||
177 | asm volatile( | ||
178 | " rsch\n" | ||
179 | " ipm %0\n" | ||
180 | " srl %0,28" | ||
181 | : "=d" (ccode) | ||
182 | : "d" (reg1) | ||
183 | : "cc", "memory"); | ||
184 | return ccode; | ||
185 | } | ||
186 | |||
187 | static inline int hsch(struct subchannel_id schid) | ||
188 | { | ||
189 | register struct subchannel_id reg1 asm("1") = schid; | ||
190 | int ccode; | ||
191 | |||
192 | asm volatile( | ||
193 | " hsch\n" | ||
194 | " ipm %0\n" | ||
195 | " srl %0,28" | ||
196 | : "=d" (ccode) | ||
197 | : "d" (reg1) | ||
198 | : "cc"); | ||
199 | return ccode; | ||
200 | } | ||
201 | |||
202 | static inline int xsch(struct subchannel_id schid) | ||
203 | { | ||
204 | register struct subchannel_id reg1 asm("1") = schid; | ||
205 | int ccode; | ||
206 | |||
207 | asm volatile( | ||
208 | " xsch\n" | ||
209 | " ipm %0\n" | ||
210 | " srl %0,28" | ||
211 | : "=d" (ccode) | ||
212 | : "d" (reg1) | ||
213 | : "cc"); | ||
214 | return ccode; | ||
215 | } | ||
216 | |||
217 | #endif | 172 | #endif |
diff --git a/drivers/s390/cio/ioasm.h b/drivers/s390/cio/ioasm.h index be6e2f5e11f7..dce25500812a 100644 --- a/drivers/s390/cio/ioasm.h +++ b/drivers/s390/cio/ioasm.h | |||
@@ -3,25 +3,11 @@ | |||
3 | 3 | ||
4 | #include <asm/chpid.h> | 4 | #include <asm/chpid.h> |
5 | #include <asm/schid.h> | 5 | #include <asm/schid.h> |
6 | #include <asm/crw.h> | ||
6 | #include "orb.h" | 7 | #include "orb.h" |
7 | #include "cio.h" | 8 | #include "cio.h" |
8 | 9 | ||
9 | /* | 10 | /* |
10 | * TPI info structure | ||
11 | */ | ||
12 | struct tpi_info { | ||
13 | struct subchannel_id schid; | ||
14 | __u32 intparm; /* interruption parameter */ | ||
15 | __u32 adapter_IO : 1; | ||
16 | __u32 reserved2 : 1; | ||
17 | __u32 isc : 3; | ||
18 | __u32 reserved3 : 12; | ||
19 | __u32 int_type : 3; | ||
20 | __u32 reserved4 : 12; | ||
21 | } __attribute__ ((packed)); | ||
22 | |||
23 | |||
24 | /* | ||
25 | * Some S390 specific IO instructions as inline | 11 | * Some S390 specific IO instructions as inline |
26 | */ | 12 | */ |
27 | 13 | ||
@@ -149,4 +135,63 @@ static inline int rchp(struct chp_id chpid) | |||
149 | return ccode; | 135 | return ccode; |
150 | } | 136 | } |
151 | 137 | ||
138 | static inline int rsch(struct subchannel_id schid) | ||
139 | { | ||
140 | register struct subchannel_id reg1 asm("1") = schid; | ||
141 | int ccode; | ||
142 | |||
143 | asm volatile( | ||
144 | " rsch\n" | ||
145 | " ipm %0\n" | ||
146 | " srl %0,28" | ||
147 | : "=d" (ccode) | ||
148 | : "d" (reg1) | ||
149 | : "cc", "memory"); | ||
150 | return ccode; | ||
151 | } | ||
152 | |||
153 | static inline int hsch(struct subchannel_id schid) | ||
154 | { | ||
155 | register struct subchannel_id reg1 asm("1") = schid; | ||
156 | int ccode; | ||
157 | |||
158 | asm volatile( | ||
159 | " hsch\n" | ||
160 | " ipm %0\n" | ||
161 | " srl %0,28" | ||
162 | : "=d" (ccode) | ||
163 | : "d" (reg1) | ||
164 | : "cc"); | ||
165 | return ccode; | ||
166 | } | ||
167 | |||
168 | static inline int xsch(struct subchannel_id schid) | ||
169 | { | ||
170 | register struct subchannel_id reg1 asm("1") = schid; | ||
171 | int ccode; | ||
172 | |||
173 | asm volatile( | ||
174 | " xsch\n" | ||
175 | " ipm %0\n" | ||
176 | " srl %0,28" | ||
177 | : "=d" (ccode) | ||
178 | : "d" (reg1) | ||
179 | : "cc"); | ||
180 | return ccode; | ||
181 | } | ||
182 | |||
183 | static inline int stcrw(struct crw *crw) | ||
184 | { | ||
185 | int ccode; | ||
186 | |||
187 | asm volatile( | ||
188 | " stcrw 0(%2)\n" | ||
189 | " ipm %0\n" | ||
190 | " srl %0,28\n" | ||
191 | : "=d" (ccode), "=m" (*crw) | ||
192 | : "a" (crw) | ||
193 | : "cc"); | ||
194 | return ccode; | ||
195 | } | ||
196 | |||
152 | #endif | 197 | #endif |