Skip to content

Commit 6816e21

Browse files
committed
s390/sclp: Convert to use flag output macros
Use flag output macros in inline asm to allow for better code generation if the compiler has support for the flag output constraint. Reviewed-by: Juergen Christ <jchrist@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent cd5e5a3 commit 6816e21

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

drivers/s390/char/sclp.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <asm/asm-extable.h>
1515
#include <asm/sclp.h>
1616
#include <asm/ebcdic.h>
17+
#include <asm/asm.h>
1718

1819
/* maximum number of pages concerning our own memory management */
1920
#define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
@@ -325,19 +326,22 @@ struct read_info_sccb * __init sclp_early_get_info(void);
325326
/* Perform service call. Return 0 on success, non-zero otherwise. */
326327
static inline int sclp_service_call(sclp_cmdw_t command, void *sccb)
327328
{
328-
int cc = 4; /* Initialize for program check handling */
329+
int cc, exception;
329330

331+
exception = 1;
330332
asm volatile(
331-
"0: .insn rre,0xb2200000,%1,%2\n" /* servc %1,%2 */
332-
"1: ipm %0\n"
333-
" srl %0,28\n"
333+
"0: .insn rre,0xb2200000,%[cmd],%[sccb]\n" /* servc */
334+
"1: lhi %[exc],0\n"
334335
"2:\n"
336+
CC_IPM(cc)
335337
EX_TABLE(0b, 2b)
336338
EX_TABLE(1b, 2b)
337-
: "+&d" (cc) : "d" (command), "a" (__pa(sccb))
338-
: "cc", "memory");
339-
if (cc == 4)
339+
: CC_OUT(cc, cc), [exc] "+d" (exception)
340+
: [cmd] "d" (command), [sccb] "a" (__pa(sccb))
341+
: CC_CLOBBER_LIST("memory"));
342+
if (exception)
340343
return -EINVAL;
344+
cc = CC_TRANSFORM(cc);
341345
if (cc == 3)
342346
return -EIO;
343347
if (cc == 2)

0 commit comments

Comments
 (0)