Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aae0560 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

s390/time: rename tod clock access functions



Fix name clash with some common code device drivers and add "tod"
to all tod clock access function names.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 58fece78
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -108,7 +108,7 @@ static void appldata_get_mem_data(void *data)
	mem_data->totalswap = P2K(val.totalswap);
	mem_data->totalswap = P2K(val.totalswap);
	mem_data->freeswap  = P2K(val.freeswap);
	mem_data->freeswap  = P2K(val.freeswap);


	mem_data->timestamp = get_clock();
	mem_data->timestamp = get_tod_clock();
	mem_data->sync_count_2++;
	mem_data->sync_count_2++;
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -111,7 +111,7 @@ static void appldata_get_net_sum_data(void *data)
	net_data->tx_dropped = tx_dropped;
	net_data->tx_dropped = tx_dropped;
	net_data->collisions = collisions;
	net_data->collisions = collisions;


	net_data->timestamp = get_clock();
	net_data->timestamp = get_tod_clock();
	net_data->sync_count_2++;
	net_data->sync_count_2++;
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@ static void appldata_get_os_data(void *data)
		}
		}
		ops.size = new_size;
		ops.size = new_size;
	}
	}
	os_data->timestamp = get_clock();
	os_data->timestamp = get_tod_clock();
	os_data->sync_count_2++;
	os_data->sync_count_2++;
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -245,7 +245,7 @@ static int dbfs_diag2fc_create(void **data, void **data_free_ptr, size_t *size)
	d2fc = diag2fc_store(guest_query, &count, sizeof(d2fc->hdr));
	d2fc = diag2fc_store(guest_query, &count, sizeof(d2fc->hdr));
	if (IS_ERR(d2fc))
	if (IS_ERR(d2fc))
		return PTR_ERR(d2fc);
		return PTR_ERR(d2fc);
	get_clock_ext(d2fc->hdr.tod_ext);
	get_tod_clock_ext(d2fc->hdr.tod_ext);
	d2fc->hdr.len = count * sizeof(struct diag2fc_data);
	d2fc->hdr.len = count * sizeof(struct diag2fc_data);
	d2fc->hdr.version = DBFS_D2FC_HDR_VERSION;
	d2fc->hdr.version = DBFS_D2FC_HDR_VERSION;
	d2fc->hdr.count = count;
	d2fc->hdr.count = count;
+9 −9
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL


/* Inline functions for clock register access. */
/* Inline functions for clock register access. */
static inline int set_clock(__u64 time)
static inline int set_tod_clock(__u64 time)
{
{
	int cc;
	int cc;


@@ -27,7 +27,7 @@ static inline int set_clock(__u64 time)
	return cc;
	return cc;
}
}


static inline int store_clock(__u64 *time)
static inline int store_tod_clock(__u64 *time)
{
{
	int cc;
	int cc;


@@ -71,7 +71,7 @@ static inline void local_tick_enable(unsigned long long comp)


typedef unsigned long long cycles_t;
typedef unsigned long long cycles_t;


static inline unsigned long long get_clock(void)
static inline unsigned long long get_tod_clock(void)
{
{
	unsigned long long clk;
	unsigned long long clk;


@@ -83,21 +83,21 @@ static inline unsigned long long get_clock(void)
	return clk;
	return clk;
}
}


static inline void get_clock_ext(char *clk)
static inline void get_tod_clock_ext(char *clk)
{
{
	asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
	asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
}
}


static inline unsigned long long get_clock_xt(void)
static inline unsigned long long get_tod_clock_xt(void)
{
{
	unsigned char clk[16];
	unsigned char clk[16];
	get_clock_ext(clk);
	get_tod_clock_ext(clk);
	return *((unsigned long long *)&clk[1]);
	return *((unsigned long long *)&clk[1]);
}
}


static inline cycles_t get_cycles(void)
static inline cycles_t get_cycles(void)
{
{
	return (cycles_t) get_clock() >> 2;
	return (cycles_t) get_tod_clock() >> 2;
}
}


int get_sync_clock(unsigned long long *clock);
int get_sync_clock(unsigned long long *clock);
@@ -123,9 +123,9 @@ extern u64 sched_clock_base_cc;
 * function, otherwise the returned value is not guaranteed to
 * function, otherwise the returned value is not guaranteed to
 * be monotonic.
 * be monotonic.
 */
 */
static inline unsigned long long get_clock_monotonic(void)
static inline unsigned long long get_tod_clock_monotonic(void)
{
{
	return get_clock_xt() - sched_clock_base_cc;
	return get_tod_clock_xt() - sched_clock_base_cc;
}
}


/**
/**
Loading