1 // SPDX-License-Identifier: GPL-2.0
3 * Channel subsystem I/O instructions.
6 #include <linux/export.h>
16 static inline int __stsch(struct subchannel_id schid
, struct schib
*addr
)
18 register struct subchannel_id reg1
asm ("1") = schid
;
27 : "+d" (ccode
), "=m" (*addr
)
28 : "d" (reg1
), "a" (addr
)
33 int stsch(struct subchannel_id schid
, struct schib
*addr
)
37 ccode
= __stsch(schid
, addr
);
38 trace_s390_cio_stsch(schid
, addr
, ccode
);
44 static inline int __msch(struct subchannel_id schid
, struct schib
*addr
)
46 register struct subchannel_id reg1
asm ("1") = schid
;
56 : "d" (reg1
), "a" (addr
), "m" (*addr
)
61 int msch(struct subchannel_id schid
, struct schib
*addr
)
65 ccode
= __msch(schid
, addr
);
66 trace_s390_cio_msch(schid
, addr
, ccode
);
71 static inline int __tsch(struct subchannel_id schid
, struct irb
*addr
)
73 register struct subchannel_id reg1
asm ("1") = schid
;
80 : "=d" (ccode
), "=m" (*addr
)
81 : "d" (reg1
), "a" (addr
)
86 int tsch(struct subchannel_id schid
, struct irb
*addr
)
90 ccode
= __tsch(schid
, addr
);
91 trace_s390_cio_tsch(schid
, addr
, ccode
);
96 static inline int __ssch(struct subchannel_id schid
, union orb
*addr
)
98 register struct subchannel_id reg1
asm("1") = schid
;
108 : "d" (reg1
), "a" (addr
), "m" (*addr
)
113 int ssch(struct subchannel_id schid
, union orb
*addr
)
117 ccode
= __ssch(schid
, addr
);
118 trace_s390_cio_ssch(schid
, addr
, ccode
);
124 static inline int __csch(struct subchannel_id schid
)
126 register struct subchannel_id reg1
asm("1") = schid
;
139 int csch(struct subchannel_id schid
)
143 ccode
= __csch(schid
);
144 trace_s390_cio_csch(schid
, ccode
);
150 int tpi(struct tpi_info
*addr
)
158 : "=d" (ccode
), "=m" (*addr
)
161 trace_s390_cio_tpi(addr
, ccode
);
166 int chsc(void *chsc_area
)
168 typedef struct { char _
[4096]; } addr_type
;
172 " .insn rre,0xb25f0000,%2,0\n"
177 : "+d" (cc
), "=m" (*(addr_type
*) chsc_area
)
178 : "d" (chsc_area
), "m" (*(addr_type
*) chsc_area
)
180 trace_s390_cio_chsc(chsc_area
, cc
);
186 static inline int __rchp(struct chp_id chpid
)
188 register struct chp_id reg1
asm ("1") = chpid
;
196 : "=d" (ccode
) : "d" (reg1
) : "cc");
200 int rchp(struct chp_id chpid
)
204 ccode
= __rchp(chpid
);
205 trace_s390_cio_rchp(chpid
, ccode
);
210 static inline int __rsch(struct subchannel_id schid
)
212 register struct subchannel_id reg1
asm("1") = schid
;
226 int rsch(struct subchannel_id schid
)
230 ccode
= __rsch(schid
);
231 trace_s390_cio_rsch(schid
, ccode
);
236 static inline int __hsch(struct subchannel_id schid
)
238 register struct subchannel_id reg1
asm("1") = schid
;
251 int hsch(struct subchannel_id schid
)
255 ccode
= __hsch(schid
);
256 trace_s390_cio_hsch(schid
, ccode
);
261 static inline int __xsch(struct subchannel_id schid
)
263 register struct subchannel_id reg1
asm("1") = schid
;
276 int xsch(struct subchannel_id schid
)
280 ccode
= __xsch(schid
);
281 trace_s390_cio_xsch(schid
, ccode
);
286 int stcrw(struct crw
*crw
)
294 : "=d" (ccode
), "=m" (*crw
)
297 trace_s390_cio_stcrw(crw
, ccode
);