blk: rq_data_dir() should not return a boolean
[cris-mirror.git] / arch / s390 / kernel / diag.c
blob2f69243bf700c7fed77021d13edc63f5f57aa9dd
1 /*
2 * Implementation of s390 diagnose codes
4 * Copyright IBM Corp. 2007
5 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
6 */
8 #include <linux/module.h>
9 #include <asm/diag.h>
12 * Diagnose 14: Input spool file manipulation
14 int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode)
16 register unsigned long _ry1 asm("2") = ry1;
17 register unsigned long _ry2 asm("3") = subcode;
18 int rc = 0;
20 asm volatile(
21 " sam31\n"
22 " diag %2,2,0x14\n"
23 " sam64\n"
24 " ipm %0\n"
25 " srl %0,28\n"
26 : "=d" (rc), "+d" (_ry2)
27 : "d" (rx), "d" (_ry1)
28 : "cc");
30 return rc;
32 EXPORT_SYMBOL(diag14);
35 * Diagnose 210: Get information about a virtual device
37 int diag210(struct diag210 *addr)
40 * diag 210 needs its data below the 2GB border, so we
41 * use a static data area to be sure
43 static struct diag210 diag210_tmp;
44 static DEFINE_SPINLOCK(diag210_lock);
45 unsigned long flags;
46 int ccode;
48 spin_lock_irqsave(&diag210_lock, flags);
49 diag210_tmp = *addr;
51 asm volatile(
52 " lhi %0,-1\n"
53 " sam31\n"
54 " diag %1,0,0x210\n"
55 "0: ipm %0\n"
56 " srl %0,28\n"
57 "1: sam64\n"
58 EX_TABLE(0b, 1b)
59 : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory");
61 *addr = diag210_tmp;
62 spin_unlock_irqrestore(&diag210_lock, flags);
64 return ccode;
66 EXPORT_SYMBOL(diag210);