diff options
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd_diag.c | 34 | ||||
-rw-r--r-- | drivers/s390/block/xpram.c | 54 |
2 files changed, 22 insertions, 66 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 23fa0b2..9d051e5 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -63,44 +63,26 @@ static const u8 DASD_DIAG_CMS1[] = { 0xc3, 0xd4, 0xe2, 0xf1 };/* EBCDIC CMS1 */ * and function code cmd. * In case of an exception return 3. Otherwise return result of bitwise OR of * resulting condition code and DIAG return code. */ -static __inline__ int -dia250(void *iob, int cmd) +static inline int dia250(void *iob, int cmd) { + register unsigned long reg0 asm ("0") = (unsigned long) iob; typedef union { struct dasd_diag_init_io init_io; struct dasd_diag_rw_io rw_io; } addr_type; int rc; - __asm__ __volatile__( -#ifdef CONFIG_64BIT - " lghi %0,3\n" - " lgr 0,%3\n" - " diag 0,%2,0x250\n" - "0: ipm %0\n" - " srl %0,28\n" - " or %0,1\n" - "1:\n" - ".section __ex_table,\"a\"\n" - " .align 8\n" - " .quad 0b,1b\n" - ".previous\n" -#else - " lhi %0,3\n" - " lr 0,%3\n" + rc = 3; + asm volatile( " diag 0,%2,0x250\n" "0: ipm %0\n" " srl %0,28\n" " or %0,1\n" "1:\n" - ".section __ex_table,\"a\"\n" - " .align 4\n" - " .long 0b,1b\n" - ".previous\n" -#endif - : "=&d" (rc), "=m" (*(addr_type *) iob) - : "d" (cmd), "d" (iob), "m" (*(addr_type *) iob) - : "0", "1", "cc"); + EX_TABLE(0b,1b) + : "+d" (rc), "=m" (*(addr_type *) iob) + : "d" (cmd), "d" (reg0), "m" (*(addr_type *) iob) + : "1", "cc"); return rc; } diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index cab2c73..a04d912 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c @@ -89,28 +89,15 @@ MODULE_LICENSE("GPL"); */ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index) { - int cc; + int cc = 2; /* return unused cc 2 if pgin traps */ - __asm__ __volatile__ ( - " lhi %0,2\n" /* return unused cc 2 if pgin traps */ - " .insn rre,0xb22e0000,%1,%2\n" /* pgin %1,%2 */ - "0: ipm %0\n" - " srl %0,28\n" + asm volatile( + " .insn rre,0xb22e0000,%1,%2\n" /* pgin %1,%2 */ + "0: ipm %0\n" + " srl %0,28\n" "1:\n" -#ifndef CONFIG_64BIT - ".section __ex_table,\"a\"\n" - " .align 4\n" - " .long 0b,1b\n" - ".previous" -#else - ".section __ex_table,\"a\"\n" - " .align 8\n" - " .quad 0b,1b\n" - ".previous" -#endif - : "=&d" (cc) - : "a" (__pa(page_addr)), "a" (xpage_index) - : "cc" ); + EX_TABLE(0b,1b) + : "+d" (cc) : "a" (__pa(page_addr)), "d" (xpage_index) : "cc"); if (cc == 3) return -ENXIO; if (cc == 2) { @@ -137,28 +124,15 @@ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index) */ static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index) { - int cc; + int cc = 2; /* return unused cc 2 if pgin traps */ - __asm__ __volatile__ ( - " lhi %0,2\n" /* return unused cc 2 if pgout traps */ - " .insn rre,0xb22f0000,%1,%2\n" /* pgout %1,%2 */ - "0: ipm %0\n" - " srl %0,28\n" + asm volatile( + " .insn rre,0xb22f0000,%1,%2\n" /* pgout %1,%2 */ + "0: ipm %0\n" + " srl %0,28\n" "1:\n" -#ifndef CONFIG_64BIT - ".section __ex_table,\"a\"\n" - " .align 4\n" - " .long 0b,1b\n" - ".previous" -#else - ".section __ex_table,\"a\"\n" - " .align 8\n" - " .quad 0b,1b\n" - ".previous" -#endif - : "=&d" (cc) - : "a" (__pa(page_addr)), "a" (xpage_index) - : "cc" ); + EX_TABLE(0b,1b) + : "+d" (cc) : "a" (__pa(page_addr)), "d" (xpage_index) : "cc"); if (cc == 3) return -ENXIO; if (cc == 2) { |