2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2012-07-20 09:15:04 +00:00
|
|
|
* Copyright IBM Corp. 2004
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _S390_CPUTIME_H
|
|
|
|
#define _S390_CPUTIME_H
|
|
|
|
|
2009-06-12 08:26:21 +00:00
|
|
|
#include <linux/types.h>
|
2017-03-01 08:21:10 +00:00
|
|
|
#include <asm/timex.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2014-11-28 18:23:35 +00:00
|
|
|
#define CPUTIME_PER_USEC 4096ULL
|
|
|
|
#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
|
2012-09-08 14:14:02 +00:00
|
|
|
|
2008-12-31 14:11:39 +00:00
|
|
|
/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2014-09-30 19:59:47 +00:00
|
|
|
#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2017-03-01 08:21:10 +00:00
|
|
|
* Convert cputime to microseconds.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2017-03-01 08:16:03 +00:00
|
|
|
static inline u64 cputime_to_usecs(const u64 cputime)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2017-03-01 08:16:03 +00:00
|
|
|
return cputime >> 12;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2017-03-01 08:21:10 +00:00
|
|
|
/*
|
|
|
|
* Convert cputime to nanoseconds.
|
|
|
|
*/
|
|
|
|
#define cputime_to_nsecs(cputime) tod_to_ns(cputime)
|
|
|
|
|
2017-01-31 03:09:47 +00:00
|
|
|
u64 arch_cpu_idle_time(int cpu);
|
2009-06-12 08:26:21 +00:00
|
|
|
|
2014-10-01 08:57:57 +00:00
|
|
|
#define arch_idle_time(cpu) arch_cpu_idle_time(cpu)
|
2009-09-29 12:25:16 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* _S390_CPUTIME_H */
|