diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-09-28 10:56:43 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-09-28 10:56:43 -0400 |
commit | 94c12cc7d196bab34aaa98d38521549fa1e5ef76 (patch) | |
tree | 8e0cec0ed44445d74a2cb5160303d6b4dfb1bc31 /drivers/s390/s390mach.c | |
parent | 25d83cbfaa44e1b9170c0941c3ef52ca39f54ccc (diff) |
[S390] Inline assembly cleanup.
Major cleanup of all s390 inline assemblies. They now have a common
coding style. Quite a few have been shortened, mainly by using register
asm variables. Use of the EX_TABLE macro helps as well. The atomic ops,
bit ops and locking inlines new use the Q-constraint if a newer gcc
is used. That results in slightly better code.
Thanks to Christian Borntraeger for proof reading the changes.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/s390mach.c')
-rw-r--r-- | drivers/s390/s390mach.c | 93 |
1 files changed, 49 insertions, 44 deletions
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index a914129a4da9..479364d0332a 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c | |||
@@ -253,11 +253,12 @@ s390_revalidate_registers(struct mci *mci) | |||
253 | kill_task = 1; | 253 | kill_task = 1; |
254 | 254 | ||
255 | #ifndef CONFIG_64BIT | 255 | #ifndef CONFIG_64BIT |
256 | asm volatile("ld 0,0(%0)\n" | 256 | asm volatile( |
257 | "ld 2,8(%0)\n" | 257 | " ld 0,0(%0)\n" |
258 | "ld 4,16(%0)\n" | 258 | " ld 2,8(%0)\n" |
259 | "ld 6,24(%0)" | 259 | " ld 4,16(%0)\n" |
260 | : : "a" (&S390_lowcore.floating_pt_save_area)); | 260 | " ld 6,24(%0)" |
261 | : : "a" (&S390_lowcore.floating_pt_save_area)); | ||
261 | #endif | 262 | #endif |
262 | 263 | ||
263 | if (MACHINE_HAS_IEEE) { | 264 | if (MACHINE_HAS_IEEE) { |
@@ -274,37 +275,36 @@ s390_revalidate_registers(struct mci *mci) | |||
274 | * Floating point control register can't be restored. | 275 | * Floating point control register can't be restored. |
275 | * Task will be terminated. | 276 | * Task will be terminated. |
276 | */ | 277 | */ |
277 | asm volatile ("lfpc 0(%0)" : : "a" (&zero), "m" (zero)); | 278 | asm volatile("lfpc 0(%0)" : : "a" (&zero), "m" (zero)); |
278 | kill_task = 1; | 279 | kill_task = 1; |
279 | 280 | ||
280 | } | 281 | } else |
281 | else | 282 | asm volatile("lfpc 0(%0)" : : "a" (fpt_creg_save_area)); |
282 | asm volatile ( | 283 | |
283 | "lfpc 0(%0)" | 284 | asm volatile( |
284 | : : "a" (fpt_creg_save_area)); | 285 | " ld 0,0(%0)\n" |
285 | 286 | " ld 1,8(%0)\n" | |
286 | asm volatile("ld 0,0(%0)\n" | 287 | " ld 2,16(%0)\n" |
287 | "ld 1,8(%0)\n" | 288 | " ld 3,24(%0)\n" |
288 | "ld 2,16(%0)\n" | 289 | " ld 4,32(%0)\n" |
289 | "ld 3,24(%0)\n" | 290 | " ld 5,40(%0)\n" |
290 | "ld 4,32(%0)\n" | 291 | " ld 6,48(%0)\n" |
291 | "ld 5,40(%0)\n" | 292 | " ld 7,56(%0)\n" |
292 | "ld 6,48(%0)\n" | 293 | " ld 8,64(%0)\n" |
293 | "ld 7,56(%0)\n" | 294 | " ld 9,72(%0)\n" |
294 | "ld 8,64(%0)\n" | 295 | " ld 10,80(%0)\n" |
295 | "ld 9,72(%0)\n" | 296 | " ld 11,88(%0)\n" |
296 | "ld 10,80(%0)\n" | 297 | " ld 12,96(%0)\n" |
297 | "ld 11,88(%0)\n" | 298 | " ld 13,104(%0)\n" |
298 | "ld 12,96(%0)\n" | 299 | " ld 14,112(%0)\n" |
299 | "ld 13,104(%0)\n" | 300 | " ld 15,120(%0)\n" |
300 | "ld 14,112(%0)\n" | 301 | : : "a" (fpt_save_area)); |
301 | "ld 15,120(%0)\n" | ||
302 | : : "a" (fpt_save_area)); | ||
303 | } | 302 | } |
304 | 303 | ||
305 | /* Revalidate access registers */ | 304 | /* Revalidate access registers */ |
306 | asm volatile("lam 0,15,0(%0)" | 305 | asm volatile( |
307 | : : "a" (&S390_lowcore.access_regs_save_area)); | 306 | " lam 0,15,0(%0)" |
307 | : : "a" (&S390_lowcore.access_regs_save_area)); | ||
308 | if (!mci->ar) | 308 | if (!mci->ar) |
309 | /* | 309 | /* |
310 | * Access registers have unknown contents. | 310 | * Access registers have unknown contents. |
@@ -321,11 +321,13 @@ s390_revalidate_registers(struct mci *mci) | |||
321 | s390_handle_damage("invalid control registers."); | 321 | s390_handle_damage("invalid control registers."); |
322 | else | 322 | else |
323 | #ifdef CONFIG_64BIT | 323 | #ifdef CONFIG_64BIT |
324 | asm volatile("lctlg 0,15,0(%0)" | 324 | asm volatile( |
325 | : : "a" (&S390_lowcore.cregs_save_area)); | 325 | " lctlg 0,15,0(%0)" |
326 | : : "a" (&S390_lowcore.cregs_save_area)); | ||
326 | #else | 327 | #else |
327 | asm volatile("lctl 0,15,0(%0)" | 328 | asm volatile( |
328 | : : "a" (&S390_lowcore.cregs_save_area)); | 329 | " lctl 0,15,0(%0)" |
330 | : : "a" (&S390_lowcore.cregs_save_area)); | ||
329 | #endif | 331 | #endif |
330 | 332 | ||
331 | /* | 333 | /* |
@@ -339,20 +341,23 @@ s390_revalidate_registers(struct mci *mci) | |||
339 | * old contents (should be zero) otherwise set it to zero. | 341 | * old contents (should be zero) otherwise set it to zero. |
340 | */ | 342 | */ |
341 | if (!mci->pr) | 343 | if (!mci->pr) |
342 | asm volatile("sr 0,0\n" | 344 | asm volatile( |
343 | "sckpf" | 345 | " sr 0,0\n" |
344 | : : : "0", "cc"); | 346 | " sckpf" |
347 | : : : "0", "cc"); | ||
345 | else | 348 | else |
346 | asm volatile( | 349 | asm volatile( |
347 | "l 0,0(%0)\n" | 350 | " l 0,0(%0)\n" |
348 | "sckpf" | 351 | " sckpf" |
349 | : : "a" (&S390_lowcore.tod_progreg_save_area) : "0", "cc"); | 352 | : : "a" (&S390_lowcore.tod_progreg_save_area) |
353 | : "0", "cc"); | ||
350 | #endif | 354 | #endif |
351 | 355 | ||
352 | /* Revalidate clock comparator register */ | 356 | /* Revalidate clock comparator register */ |
353 | asm volatile ("stck 0(%1)\n" | 357 | asm volatile( |
354 | "sckc 0(%1)" | 358 | " stck 0(%1)\n" |
355 | : "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory"); | 359 | " sckc 0(%1)" |
360 | : "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory"); | ||
356 | 361 | ||
357 | /* Check if old PSW is valid */ | 362 | /* Check if old PSW is valid */ |
358 | if (!mci->wp) | 363 | if (!mci->wp) |