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 __rsch(struct subchannel_id schid
)
188 register struct subchannel_id reg1
asm("1") = schid
;
202 int rsch(struct subchannel_id schid
)
206 ccode
= __rsch(schid
);
207 trace_s390_cio_rsch(schid
, ccode
);
212 static inline int __hsch(struct subchannel_id schid
)
214 register struct subchannel_id reg1
asm("1") = schid
;
227 int hsch(struct subchannel_id schid
)
231 ccode
= __hsch(schid
);
232 trace_s390_cio_hsch(schid
, ccode
);
237 static inline int __xsch(struct subchannel_id schid
)
239 register struct subchannel_id reg1
asm("1") = schid
;
252 int xsch(struct subchannel_id schid
)
256 ccode
= __xsch(schid
);
257 trace_s390_cio_xsch(schid
, ccode
);
262 int stcrw(struct crw
*crw
)
270 : "=d" (ccode
), "=m" (*crw
)
273 trace_s390_cio_stcrw(crw
, ccode
);