]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/sclp: Convert to use flag output macros
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Nov 2024 15:11:51 +0000 (16:11 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 13 Nov 2024 13:31:34 +0000 (14:31 +0100)
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>
drivers/s390/char/sclp.h

index 6a23ec286c70211d1aa203a4f52b334d7301b861..6c91e422927ff5e81694cf15586dcd3a1c4ea83f 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/asm-extable.h>
 #include <asm/sclp.h>
 #include <asm/ebcdic.h>
+#include <asm/asm.h>
 
 /* maximum number of pages concerning our own memory management */
 #define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
@@ -325,19 +326,22 @@ struct read_info_sccb * __init sclp_early_get_info(void);
 /* Perform service call. Return 0 on success, non-zero otherwise. */
 static inline int sclp_service_call(sclp_cmdw_t command, void *sccb)
 {
-       int cc = 4; /* Initialize for program check handling */
+       int cc, exception;
 
+       exception = 1;
        asm volatile(
-               "0:     .insn   rre,0xb2200000,%1,%2\n"  /* servc %1,%2 */
-               "1:     ipm     %0\n"
-               "       srl     %0,28\n"
+               "0:     .insn   rre,0xb2200000,%[cmd],%[sccb]\n" /* servc */
+               "1:     lhi     %[exc],0\n"
                "2:\n"
+               CC_IPM(cc)
                EX_TABLE(0b, 2b)
                EX_TABLE(1b, 2b)
-               : "+&d" (cc) : "d" (command), "a" (__pa(sccb))
-               : "cc", "memory");
-       if (cc == 4)
+               : CC_OUT(cc, cc), [exc] "+d" (exception)
+               : [cmd] "d" (command), [sccb] "a" (__pa(sccb))
+               : CC_CLOBBER_LIST("memory"));
+       if (exception)
                return -EINVAL;
+       cc = CC_TRANSFORM(cc);
        if (cc == 3)
                return -EIO;
        if (cc == 2)