]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
a53c8fab | 2 | * Copyright IBM Corp. 2004 |
1da177e4 LT |
3 | * |
4 | * Author: Martin Schwidefsky <schwidefsky@de.ibm.com> | |
5 | */ | |
6 | ||
7 | #ifndef _S390_CPUTIME_H | |
8 | #define _S390_CPUTIME_H | |
9 | ||
76d4e00a | 10 | #include <linux/types.h> |
e53051e7 | 11 | #include <asm/timex.h> |
1da177e4 | 12 | |
8461b63c FW |
13 | #define CPUTIME_PER_USEC 4096ULL |
14 | #define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC) | |
a7e1a9e3 | 15 | |
aa5e97ce | 16 | /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ |
1da177e4 | 17 | |
347abad9 RR |
18 | #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new) |
19 | ||
1da177e4 | 20 | /* |
e53051e7 | 21 | * Convert cputime to microseconds. |
1da177e4 | 22 | */ |
e69ca822 | 23 | static inline u64 cputime_to_usecs(const u64 cputime) |
1da177e4 | 24 | { |
e69ca822 | 25 | return cputime >> 12; |
1da177e4 LT |
26 | } |
27 | ||
e53051e7 MS |
28 | /* |
29 | * Convert cputime to nanoseconds. | |
30 | */ | |
31 | #define cputime_to_nsecs(cputime) tod_to_ns(cputime) | |
32 | ||
42b425b3 | 33 | u64 arch_cpu_idle_time(int cpu); |
76d4e00a | 34 | |
b5f87f15 | 35 | #define arch_idle_time(cpu) arch_cpu_idle_time(cpu) |
3c5d92a0 | 36 | |
1da177e4 | 37 | #endif /* _S390_CPUTIME_H */ |