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