Skip to content

Commit 81c54fc

Browse files
committed
s390/time: 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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 34c4812 commit 81c54fc

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

arch/s390/include/asm/timex.h

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/preempt.h>
1414
#include <linux/time64.h>
1515
#include <asm/lowcore.h>
16+
#include <asm/asm.h>
1617

1718
/* The value of the TOD clock for 1.1.1970. */
1819
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
@@ -44,23 +45,25 @@ static inline int set_tod_clock(__u64 time)
4445
int cc;
4546

4647
asm volatile(
47-
" sck %1\n"
48-
" ipm %0\n"
49-
" srl %0,28\n"
50-
: "=d" (cc) : "Q" (time) : "cc");
51-
return cc;
48+
" sck %[time]\n"
49+
CC_IPM(cc)
50+
: CC_OUT(cc, cc)
51+
: [time] "Q" (time)
52+
: CC_CLOBBER);
53+
return CC_TRANSFORM(cc);
5254
}
5355

5456
static inline int store_tod_clock_ext_cc(union tod_clock *clk)
5557
{
5658
int cc;
5759

5860
asm volatile(
59-
" stcke %1\n"
60-
" ipm %0\n"
61-
" srl %0,28\n"
62-
: "=d" (cc), "=Q" (*clk) : : "cc");
63-
return cc;
61+
" stcke %[clk]\n"
62+
CC_IPM(cc)
63+
: CC_OUT(cc, cc), [clk] "=Q" (*clk)
64+
:
65+
: CC_CLOBBER);
66+
return CC_TRANSFORM(cc);
6467
}
6568

6669
static __always_inline void store_tod_clock_ext(union tod_clock *tod)
@@ -149,12 +152,11 @@ struct ptff_qui {
149152
" lgr 0,%[reg0]\n" \
150153
" lgr 1,%[reg1]\n" \
151154
" ptff\n" \
152-
" ipm %[rc]\n" \
153-
" srl %[rc],28\n" \
154-
: [rc] "=&d" (rc), "+m" (*(struct addrtype *)reg1) \
155+
CC_IPM(rc) \
156+
: CC_OUT(rc, rc), "+m" (*(struct addrtype *)reg1) \
155157
: [reg0] "d" (reg0), [reg1] "d" (reg1) \
156-
: "cc", "0", "1"); \
157-
rc; \
158+
: CC_CLOBBER_LIST("0", "1")); \
159+
CC_TRANSFORM(rc); \
158160
})
159161

160162
static inline unsigned long local_tick_disable(void)

0 commit comments

Comments
 (0)