diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-12-05 13:13:36 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-12-16 08:37:48 -0500 |
commit | 5d5de1a068efffb0dcc03235e6fa258201096f02 (patch) | |
tree | a986c64b55b315d13a675bdb73ea3a9aae683a0d /drivers/s390 | |
parent | 56e57a84a7856130f45009ce1713dc8ec8e59887 (diff) |
s390/sclp_early: Pass sccb pointer to every *_detect() function
Add a sccb pointer parameter to *_detect() functions instead of accessing
the global sccb_early variable directly.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/sclp_early.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c index dc4ed04cbf50..1af3555c096d 100644 --- a/drivers/s390/char/sclp_early.c +++ b/drivers/s390/char/sclp_early.c | |||
@@ -87,10 +87,8 @@ static int __init sclp_read_info_early(struct read_info_sccb *sccb) | |||
87 | return -EIO; | 87 | return -EIO; |
88 | } | 88 | } |
89 | 89 | ||
90 | static void __init sclp_facilities_detect(void) | 90 | static void __init sclp_facilities_detect(struct read_info_sccb *sccb) |
91 | { | 91 | { |
92 | struct read_info_sccb *sccb = (void *) &sccb_early; | ||
93 | |||
94 | if (sclp_read_info_early(sccb)) | 92 | if (sclp_read_info_early(sccb)) |
95 | return; | 93 | return; |
96 | 94 | ||
@@ -181,11 +179,10 @@ static void __init sccb_init_eq_size(struct sdias_sccb *sccb) | |||
181 | sccb->evbuf.dbs = 1; | 179 | sccb->evbuf.dbs = 1; |
182 | } | 180 | } |
183 | 181 | ||
184 | static int __init sclp_set_event_mask(unsigned long receive_mask, | 182 | static int __init sclp_set_event_mask(struct init_sccb *sccb, |
183 | unsigned long receive_mask, | ||
185 | unsigned long send_mask) | 184 | unsigned long send_mask) |
186 | { | 185 | { |
187 | struct init_sccb *sccb = (void *) &sccb_early; | ||
188 | |||
189 | memset(sccb, 0, sizeof(*sccb)); | 186 | memset(sccb, 0, sizeof(*sccb)); |
190 | sccb->header.length = sizeof(*sccb); | 187 | sccb->header.length = sizeof(*sccb); |
191 | sccb->mask_length = sizeof(sccb_mask_t); | 188 | sccb->mask_length = sizeof(sccb_mask_t); |
@@ -194,10 +191,8 @@ static int __init sclp_set_event_mask(unsigned long receive_mask, | |||
194 | return sclp_cmd_early(SCLP_CMDW_WRITE_EVENT_MASK, sccb); | 191 | return sclp_cmd_early(SCLP_CMDW_WRITE_EVENT_MASK, sccb); |
195 | } | 192 | } |
196 | 193 | ||
197 | static long __init sclp_hsa_size_init(void) | 194 | static long __init sclp_hsa_size_init(struct sdias_sccb *sccb) |
198 | { | 195 | { |
199 | struct sdias_sccb *sccb = (void *) &sccb_early; | ||
200 | |||
201 | sccb_init_eq_size(sccb); | 196 | sccb_init_eq_size(sccb); |
202 | if (sclp_cmd_early(SCLP_CMDW_WRITE_EVENT_DATA, sccb)) | 197 | if (sclp_cmd_early(SCLP_CMDW_WRITE_EVENT_DATA, sccb)) |
203 | return -EIO; | 198 | return -EIO; |
@@ -206,10 +201,8 @@ static long __init sclp_hsa_size_init(void) | |||
206 | return 0; | 201 | return 0; |
207 | } | 202 | } |
208 | 203 | ||
209 | static long __init sclp_hsa_copy_wait(void) | 204 | static long __init sclp_hsa_copy_wait(struct sccb_header *sccb) |
210 | { | 205 | { |
211 | struct sccb_header *sccb = (void *) &sccb_early; | ||
212 | |||
213 | memset(sccb, 0, PAGE_SIZE); | 206 | memset(sccb, 0, PAGE_SIZE); |
214 | sccb->length = PAGE_SIZE; | 207 | sccb->length = PAGE_SIZE; |
215 | if (sclp_cmd_early(SCLP_CMDW_READ_EVENT_DATA, sccb)) | 208 | if (sclp_cmd_early(SCLP_CMDW_READ_EVENT_DATA, sccb)) |
@@ -222,25 +215,25 @@ unsigned long sclp_get_hsa_size(void) | |||
222 | return sclp_hsa_size; | 215 | return sclp_hsa_size; |
223 | } | 216 | } |
224 | 217 | ||
225 | static void __init sclp_hsa_size_detect(void) | 218 | static void __init sclp_hsa_size_detect(void *sccb) |
226 | { | 219 | { |
227 | long size; | 220 | long size; |
228 | 221 | ||
229 | /* First try synchronous interface (LPAR) */ | 222 | /* First try synchronous interface (LPAR) */ |
230 | if (sclp_set_event_mask(0, 0x40000010)) | 223 | if (sclp_set_event_mask(sccb, 0, 0x40000010)) |
231 | return; | 224 | return; |
232 | size = sclp_hsa_size_init(); | 225 | size = sclp_hsa_size_init(sccb); |
233 | if (size < 0) | 226 | if (size < 0) |
234 | return; | 227 | return; |
235 | if (size != 0) | 228 | if (size != 0) |
236 | goto out; | 229 | goto out; |
237 | /* Then try asynchronous interface (z/VM) */ | 230 | /* Then try asynchronous interface (z/VM) */ |
238 | if (sclp_set_event_mask(0x00000010, 0x40000010)) | 231 | if (sclp_set_event_mask(sccb, 0x00000010, 0x40000010)) |
239 | return; | 232 | return; |
240 | size = sclp_hsa_size_init(); | 233 | size = sclp_hsa_size_init(sccb); |
241 | if (size < 0) | 234 | if (size < 0) |
242 | return; | 235 | return; |
243 | size = sclp_hsa_copy_wait(); | 236 | size = sclp_hsa_copy_wait(sccb); |
244 | if (size < 0) | 237 | if (size < 0) |
245 | return; | 238 | return; |
246 | out: | 239 | out: |
@@ -249,7 +242,9 @@ out: | |||
249 | 242 | ||
250 | void __init sclp_early_detect(void) | 243 | void __init sclp_early_detect(void) |
251 | { | 244 | { |
252 | sclp_facilities_detect(); | 245 | void *sccb = &sccb_early; |
253 | sclp_hsa_size_detect(); | 246 | |
254 | sclp_set_event_mask(0, 0); | 247 | sclp_facilities_detect(sccb); |
248 | sclp_hsa_size_detect(sccb); | ||
249 | sclp_set_event_mask(sccb, 0, 0); | ||
255 | } | 250 | } |