From 76d4e00a05d06c1d1552adea24fcf6182c9d8999 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Fri, 12 Jun 2009 10:26:21 +0200 Subject: [S390] merge cpu.h into cputime.h All definition in cpu.h have to do with cputime accounting. Move them to cputime.h and remove the header file. Signed-off-by: Martin Schwidefsky --- arch/s390/include/asm/cputime.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arch/s390/include/asm/cputime.h') diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 941384fbd39..ec917d42ee6 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h @@ -9,6 +9,9 @@ #ifndef _S390_CPUTIME_H #define _S390_CPUTIME_H +#include +#include +#include #include /* 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) return __div(cputime, 4096000000ULL / USER_HZ); } +struct s390_idle_data { + spinlock_t lock; + unsigned long long idle_count; + unsigned long long idle_enter; + unsigned long long idle_time; +}; + +DECLARE_PER_CPU(struct s390_idle_data, s390_idle); + +void vtime_start_cpu(void); cputime64_t s390_get_idle_time(int cpu); #define arch_idle_time(cpu) s390_get_idle_time(cpu) +static inline void s390_idle_check(void) +{ + if ((&__get_cpu_var(s390_idle))->idle_enter != 0ULL) + vtime_start_cpu(); +} + #endif /* _S390_CPUTIME_H */ -- cgit v1.2.3