diff options
Diffstat (limited to 'arch/s390/include/asm/cputime.h')
| -rw-r--r-- | arch/s390/include/asm/cputime.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 941384fbd39c..ec917d42ee6d 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
| @@ -9,6 +9,9 @@ | |||
| 9 | #ifndef _S390_CPUTIME_H | 9 | #ifndef _S390_CPUTIME_H |
| 10 | #define _S390_CPUTIME_H | 10 | #define _S390_CPUTIME_H |
| 11 | 11 | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/percpu.h> | ||
| 14 | #include <linux/spinlock.h> | ||
| 12 | #include <asm/div64.h> | 15 | #include <asm/div64.h> |
| 13 | 16 | ||
| 14 | /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ | 17 | /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ |
| @@ -174,8 +177,24 @@ cputime64_to_clock_t(cputime64_t cputime) | |||
| 174 | return __div(cputime, 4096000000ULL / USER_HZ); | 177 | return __div(cputime, 4096000000ULL / USER_HZ); |
| 175 | } | 178 | } |
| 176 | 179 | ||
| 180 | struct s390_idle_data { | ||
| 181 | spinlock_t lock; | ||
| 182 | unsigned long long idle_count; | ||
| 183 | unsigned long long idle_enter; | ||
| 184 | unsigned long long idle_time; | ||
| 185 | }; | ||
| 186 | |||
| 187 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); | ||
| 188 | |||
| 189 | void vtime_start_cpu(void); | ||
| 177 | cputime64_t s390_get_idle_time(int cpu); | 190 | cputime64_t s390_get_idle_time(int cpu); |
| 178 | 191 | ||
| 179 | #define arch_idle_time(cpu) s390_get_idle_time(cpu) | 192 | #define arch_idle_time(cpu) s390_get_idle_time(cpu) |
| 180 | 193 | ||
| 194 | static inline void s390_idle_check(void) | ||
| 195 | { | ||
| 196 | if ((&__get_cpu_var(s390_idle))->idle_enter != 0ULL) | ||
| 197 | vtime_start_cpu(); | ||
| 198 | } | ||
| 199 | |||
| 181 | #endif /* _S390_CPUTIME_H */ | 200 | #endif /* _S390_CPUTIME_H */ |
