Update libata drive blacklist to the latest from 2.6.21
[linux/fpc-iii.git] / drivers / s390 / cio / ioasm.h
blobad6d829400691826659cf3de58ff35f0fa8eed98
1 #ifndef S390_CIO_IOASM_H
2 #define S390_CIO_IOASM_H
4 #include "schid.h"
6 /*
7 * TPI info structure
8 */
9 struct tpi_info {
10 struct subchannel_id schid;
11 __u32 intparm; /* interruption parameter */
12 __u32 adapter_IO : 1;
13 __u32 reserved2 : 1;
14 __u32 isc : 3;
15 __u32 reserved3 : 12;
16 __u32 int_type : 3;
17 __u32 reserved4 : 12;
18 } __attribute__ ((packed));
22 * Some S390 specific IO instructions as inline
25 static inline int stsch(struct subchannel_id schid,
26 volatile struct schib *addr)
28 register struct subchannel_id reg1 asm ("1") = schid;
29 int ccode;
31 asm volatile(
32 " stsch 0(%2)\n"
33 " ipm %0\n"
34 " srl %0,28"
35 : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
36 return ccode;
39 static inline int stsch_err(struct subchannel_id schid,
40 volatile struct schib *addr)
42 register struct subchannel_id reg1 asm ("1") = schid;
43 int ccode = -EIO;
45 asm volatile(
46 " stsch 0(%2)\n"
47 "0: ipm %0\n"
48 " srl %0,28\n"
49 "1:\n"
50 EX_TABLE(0b,1b)
51 : "+d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
52 return ccode;
55 static inline int msch(struct subchannel_id schid,
56 volatile struct schib *addr)
58 register struct subchannel_id reg1 asm ("1") = schid;
59 int ccode;
61 asm volatile(
62 " msch 0(%2)\n"
63 " ipm %0\n"
64 " srl %0,28"
65 : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
66 return ccode;
69 static inline int msch_err(struct subchannel_id schid,
70 volatile struct schib *addr)
72 register struct subchannel_id reg1 asm ("1") = schid;
73 int ccode = -EIO;
75 asm volatile(
76 " msch 0(%2)\n"
77 "0: ipm %0\n"
78 " srl %0,28\n"
79 "1:\n"
80 EX_TABLE(0b,1b)
81 : "+d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
82 return ccode;
85 static inline int tsch(struct subchannel_id schid,
86 volatile struct irb *addr)
88 register struct subchannel_id reg1 asm ("1") = schid;
89 int ccode;
91 asm volatile(
92 " tsch 0(%2)\n"
93 " ipm %0\n"
94 " srl %0,28"
95 : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
96 return ccode;
99 static inline int tpi( volatile struct tpi_info *addr)
101 int ccode;
103 asm volatile(
104 " tpi 0(%1)\n"
105 " ipm %0\n"
106 " srl %0,28"
107 : "=d" (ccode) : "a" (addr), "m" (*addr) : "cc");
108 return ccode;
111 static inline int ssch(struct subchannel_id schid,
112 volatile struct orb *addr)
114 register struct subchannel_id reg1 asm ("1") = schid;
115 int ccode;
117 asm volatile(
118 " ssch 0(%2)\n"
119 " ipm %0\n"
120 " srl %0,28"
121 : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc");
122 return ccode;
125 static inline int rsch(struct subchannel_id schid)
127 register struct subchannel_id reg1 asm ("1") = schid;
128 int ccode;
130 asm volatile(
131 " rsch\n"
132 " ipm %0\n"
133 " srl %0,28"
134 : "=d" (ccode) : "d" (reg1) : "cc");
135 return ccode;
138 static inline int csch(struct subchannel_id schid)
140 register struct subchannel_id reg1 asm ("1") = schid;
141 int ccode;
143 asm volatile(
144 " csch\n"
145 " ipm %0\n"
146 " srl %0,28"
147 : "=d" (ccode) : "d" (reg1) : "cc");
148 return ccode;
151 static inline int hsch(struct subchannel_id schid)
153 register struct subchannel_id reg1 asm ("1") = schid;
154 int ccode;
156 asm volatile(
157 " hsch\n"
158 " ipm %0\n"
159 " srl %0,28"
160 : "=d" (ccode) : "d" (reg1) : "cc");
161 return ccode;
164 static inline int xsch(struct subchannel_id schid)
166 register struct subchannel_id reg1 asm ("1") = schid;
167 int ccode;
169 asm volatile(
170 " .insn rre,0xb2760000,%1,0\n"
171 " ipm %0\n"
172 " srl %0,28"
173 : "=d" (ccode) : "d" (reg1) : "cc");
174 return ccode;
177 static inline int chsc(void *chsc_area)
179 typedef struct { char _[4096]; } addr_type;
180 int cc;
182 asm volatile(
183 " .insn rre,0xb25f0000,%2,0\n"
184 " ipm %0\n"
185 " srl %0,28\n"
186 : "=d" (cc), "=m" (*(addr_type *) chsc_area)
187 : "d" (chsc_area), "m" (*(addr_type *) chsc_area)
188 : "cc");
189 return cc;
192 static inline int rchp(int chpid)
194 register unsigned int reg1 asm ("1") = chpid;
195 int ccode;
197 asm volatile(
198 " lr 1,%1\n"
199 " rchp\n"
200 " ipm %0\n"
201 " srl %0,28"
202 : "=d" (ccode) : "d" (reg1) : "cc");
203 return ccode;
206 #endif