]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390/timex: get rid of register asm
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 17 Jun 2021 09:32:53 +0000 (11:32 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 28 Jun 2021 09:18:28 +0000 (11:18 +0200)
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/timex.h

index f6326c6d2abe83536a340f0829b95cdd6cdb4f7b..50d9b04ecbd147b2f9c202145811e28611a3e7cc 100644 (file)
@@ -75,9 +75,12 @@ static inline void set_clock_comparator(__u64 time)
 
 static inline void set_tod_programmable_field(u16 val)
 {
-       register unsigned long reg0 asm("0") = val;
-
-       asm volatile("sckpf" : : "d" (reg0));
+       asm volatile(
+               "       lgr     0,%[val]\n"
+               "       sckpf\n"
+               :
+               : [val] "d" ((unsigned long)val)
+               : "0");
 }
 
 void clock_comparator_work(void);
@@ -138,16 +141,19 @@ struct ptff_qui {
 #define ptff(ptff_block, len, func)                                    \
 ({                                                                     \
        struct addrtype { char _[len]; };                               \
-       register unsigned int reg0 asm("0") = func;                     \
-       register unsigned long reg1 asm("1") = (unsigned long) (ptff_block);\
+       unsigned int reg0 = func;                                       \
+       unsigned long reg1 = (unsigned long)(ptff_block);               \
        int rc;                                                         \
                                                                        \
        asm volatile(                                                   \
-               "       .word   0x0104\n"                               \
-               "       ipm     %0\n"                                   \
-               "       srl     %0,28\n"                                \
-               : "=d" (rc), "+m" (*(struct addrtype *) reg1)           \
-               : "d" (reg0), "d" (reg1) : "cc");                       \
+               "       lgr     0,%[reg0]\n"                            \
+               "       lgr     1,%[reg1]\n"                            \
+               "       .insn   e,0x0104\n"                             \
+               "       ipm     %[rc]\n"                                \
+               "       srl     %[rc],28\n"                             \
+               : [rc] "=&d" (rc), "+m" (*(struct addrtype *)reg1)      \
+               : [reg0] "d" (reg0), [reg1] "d" (reg1)                  \
+               : "cc", "0", "1");                                      \
        rc;                                                             \
 })