aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/cputime.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/cputime.h')
-rw-r--r--arch/s390/include/asm/cputime.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index d1c407ddf703..9072bf63a846 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -8,31 +8,27 @@
8#define _S390_CPUTIME_H 8#define _S390_CPUTIME_H
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11#include <asm/div64.h> 11#include <asm/timex.h>
12 12
13#define CPUTIME_PER_USEC 4096ULL 13#define CPUTIME_PER_USEC 4096ULL
14#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC) 14#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
15 15
16/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ 16/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
17 17
18typedef unsigned long long __nocast cputime_t;
19typedef unsigned long long __nocast cputime64_t;
20
21#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new) 18#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
22 19
23static inline unsigned long __div(unsigned long long n, unsigned long base)
24{
25 return n / base;
26}
27
28/* 20/*
29 * Convert cputime to microseconds and back. 21 * Convert cputime to microseconds.
30 */ 22 */
31static inline unsigned int cputime_to_usecs(const cputime_t cputime) 23static inline u64 cputime_to_usecs(const u64 cputime)
32{ 24{
33 return (__force unsigned long long) cputime >> 12; 25 return cputime >> 12;
34} 26}
35 27
28/*
29 * Convert cputime to nanoseconds.
30 */
31#define cputime_to_nsecs(cputime) tod_to_ns(cputime)
36 32
37u64 arch_cpu_idle_time(int cpu); 33u64 arch_cpu_idle_time(int cpu);
38 34