aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2006-09-28 10:56:43 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-09-28 10:56:43 -0400
commit94c12cc7d196bab34aaa98d38521549fa1e5ef76 (patch)
tree8e0cec0ed44445d74a2cb5160303d6b4dfb1bc31 /drivers/s390/net
parent25d83cbfaa44e1b9170c0941c3ef52ca39f54ccc (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/net')
-rw-r--r--drivers/s390/net/iucv.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 821dde86e240..809dd8d7f47a 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -534,19 +534,15 @@ iucv_add_handler (handler *new)
534 * 534 *
535 * Returns: return code from CP's IUCV call 535 * Returns: return code from CP's IUCV call
536 */ 536 */
537static __inline__ ulong 537static inline ulong b2f0(__u32 code, void *parm)
538b2f0(__u32 code, void *parm)
539{ 538{
539 register unsigned long reg0 asm ("0");
540 register unsigned long reg1 asm ("1");
540 iucv_dumpit("iparml before b2f0 call:", parm, sizeof(iucv_param)); 541 iucv_dumpit("iparml before b2f0 call:", parm, sizeof(iucv_param));
541 542
542 asm volatile ( 543 reg0 = code;
543 "LRA 1,0(%1)\n\t" 544 reg1 = virt_to_phys(parm);
544 "LR 0,%0\n\t" 545 asm volatile(".long 0xb2f01000" : : "d" (reg0), "a" (reg1));
545 ".long 0xb2f01000"
546 :
547 : "d" (code), "a" (parm)
548 : "0", "1"
549 );
550 546
551 iucv_dumpit("iparml after b2f0 call:", parm, sizeof(iucv_param)); 547 iucv_dumpit("iparml after b2f0 call:", parm, sizeof(iucv_param));
552 548
@@ -1248,6 +1244,8 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit)
1248static int 1244static int
1249iucv_query_generic(int want_maxconn) 1245iucv_query_generic(int want_maxconn)
1250{ 1246{
1247 register unsigned long reg0 asm ("0");
1248 register unsigned long reg1 asm ("1");
1251 iparml_purge *parm = (iparml_purge *)grab_param(); 1249 iparml_purge *parm = (iparml_purge *)grab_param();
1252 int bufsize, maxconn; 1250 int bufsize, maxconn;
1253 int ccode; 1251 int ccode;
@@ -1256,18 +1254,15 @@ iucv_query_generic(int want_maxconn)
1256 * Call b2f0 and store R0 (max buffer size), 1254 * Call b2f0 and store R0 (max buffer size),
1257 * R1 (max connections) and CC. 1255 * R1 (max connections) and CC.
1258 */ 1256 */
1259 asm volatile ( 1257 reg0 = QUERY;
1260 "LRA 1,0(%4)\n\t" 1258 reg1 = virt_to_phys(parm);
1261 "LR 0,%3\n\t" 1259 asm volatile(
1262 ".long 0xb2f01000\n\t" 1260 " .long 0xb2f01000\n"
1263 "IPM %0\n\t" 1261 " ipm %0\n"
1264 "SRL %0,28\n\t" 1262 " srl %0,28\n"
1265 "ST 0,%1\n\t" 1263 : "=d" (ccode), "+d" (reg0), "+d" (reg1) : : "cc");
1266 "ST 1,%2\n\t" 1264 bufsize = reg0;
1267 : "=d" (ccode), "=m" (bufsize), "=m" (maxconn) 1265 maxconn = reg1;
1268 : "d" (QUERY), "a" (parm)
1269 : "0", "1", "cc"
1270 );
1271 release_param(parm); 1266 release_param(parm);
1272 1267
1273 if (ccode) 1268 if (ccode)