Commit b22446d0 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik
Browse files

s390/time: use stcke instead of stck



Use STORE CLOCK EXTENDED instead of STORE CLOCK in early tod clock
setup. This is just to remove another usage of stck, trying to remove
all usages of STORE CLOCK.  This doesn't fix anything.

Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 683071b0
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
/* The value of the TOD clock for 1.1.1970. */
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL

#define STORE_CLOCK_EXT_SIZE	16	/* stcke writes 16 bytes */

extern u64 clock_comparator_max;

/* Inline functions for clock register access. */
@@ -32,15 +34,16 @@ static inline int set_tod_clock(__u64 time)
	return cc;
}

static inline int store_tod_clock(__u64 *time)
static inline int store_tod_clock_ext(char *time)
{
	typedef struct { char _[STORE_CLOCK_EXT_SIZE]; } addrtype;
	int cc;

	asm volatile(
		"   stck  %1\n"
		"   stcke  %1\n"
		"   ipm   %0\n"
		"   srl   %0,28\n"
		: "=d" (cc), "=Q" (*time) : : "cc");
		: "=d" (cc), "=Q" (*(addrtype *)time) : : "cc");
	return cc;
}

@@ -144,7 +147,6 @@ static inline void local_tick_enable(unsigned long long comp)
}

#define CLOCK_TICK_RATE		1193180 /* Underlying HZ */
#define STORE_CLOCK_EXT_SIZE	16	/* stcke writes 16 bytes */

typedef unsigned long long cycles_t;

+3 −3
Original line number Diff line number Diff line
@@ -35,12 +35,12 @@

static void __init reset_tod_clock(void)
{
	u64 time;
	char time[STORE_CLOCK_EXT_SIZE];

	if (store_tod_clock(&time) == 0)
	if (store_tod_clock_ext(time) == 0)
		return;
	/* TOD clock not running. Set the clock to Unix Epoch. */
	if (set_tod_clock(TOD_UNIX_EPOCH) != 0 || store_tod_clock(&time) != 0)
	if (set_tod_clock(TOD_UNIX_EPOCH) != 0 || store_tod_clock_ext(time) != 0)
		disabled_wait();

	memset(tod_clock_base, 0, 16);