7 #ifndef _S390_CPUTIME_H
8 #define _S390_CPUTIME_H
10 #include <linux/types.h>
13 #include <asm/div64.h>
16 #define __ARCH_HAS_VTIME_ACCOUNT
23 static inline unsigned long __div(
unsigned long long n,
unsigned long base)
29 asm (
"dr %0,%1" :
"+d" (
rp) :
"d" (base >> 1));
36 #define cputime_one_jiffy jiffies_to_cputime(1)
43 return __div((
__force unsigned long long) cputime, 4096000000ULL /
HZ);
53 unsigned long long jif = (
__force unsigned long long) cputime;
68 return (
__force unsigned long long) cputime >> 12;
76 #define usecs_to_cputime64(m) usecs_to_cputime(m)
83 return __div((
__force unsigned long long) cputime, 2048000000) >> 1;
96 unsigned long long ret = value->
tv_sec * 4096000000ULL;
103 unsigned long long __cputime = (
__force unsigned long long) cputime;
107 rp.
pair = __cputime >> 1;
108 asm (
"dr %0,%1" :
"+d" (
rp) :
"d" (2048000000
UL));
112 value->
tv_nsec = (__cputime % 4096000000ULL) * 1000 / 4096;
113 value->
tv_sec = __cputime / 4096000000ULL;
124 unsigned long long ret = value->
tv_sec * 4096000000ULL;
131 unsigned long long __cputime = (
__force unsigned long long) cputime;
135 rp.
pair = __cputime >> 1;
136 asm (
"dr %0,%1" :
"+d" (
rp) :
"d" (2048000000
UL));
140 value->
tv_usec = (__cputime % 4096000000ULL) / 4096;
141 value->
tv_sec = __cputime / 4096000000ULL;
185 #define arch_idle_time(cpu) s390_get_idle_time(cpu)
187 static inline int s390_nohz_delay(
int cpu)
192 #define arch_needs_cpu(cpu) s390_nohz_delay(cpu)