aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/cputime.h8
-rw-r--r--include/asm-generic/cputime_nsecs.h8
2 files changed, 15 insertions, 1 deletions
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h
index c6eddf50eaf9..51969436b8b8 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -4,6 +4,12 @@
4#include <linux/time.h> 4#include <linux/time.h>
5#include <linux/jiffies.h> 5#include <linux/jiffies.h>
6 6
7#include <asm-generic/cputime_jiffies.h> 7#ifndef CONFIG_VIRT_CPU_ACCOUNTING
8# include <asm-generic/cputime_jiffies.h>
9#endif
10
11#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
12# include <asm-generic/cputime_nsecs.h>
13#endif
8 14
9#endif 15#endif
diff --git a/include/asm-generic/cputime_nsecs.h b/include/asm-generic/cputime_nsecs.h
index c73d182f4751..b6485cafb7bd 100644
--- a/include/asm-generic/cputime_nsecs.h
+++ b/include/asm-generic/cputime_nsecs.h
@@ -26,6 +26,7 @@ typedef u64 __nocast cputime64_t;
26 */ 26 */
27#define cputime_to_jiffies(__ct) \ 27#define cputime_to_jiffies(__ct) \
28 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ)) 28 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ))
29#define cputime_to_scaled(__ct) (__ct)
29#define jiffies_to_cputime(__jif) \ 30#define jiffies_to_cputime(__jif) \
30 (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ)) 31 (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ))
31#define cputime64_to_jiffies64(__ct) \ 32#define cputime64_to_jiffies64(__ct) \
@@ -33,6 +34,13 @@ typedef u64 __nocast cputime64_t;
33#define jiffies64_to_cputime64(__jif) \ 34#define jiffies64_to_cputime64(__jif) \
34 (__force cputime64_t)((__jif) * (NSEC_PER_SEC / HZ)) 35 (__force cputime64_t)((__jif) * (NSEC_PER_SEC / HZ))
35 36
37
38/*
39 * Convert cputime <-> nanoseconds
40 */
41#define nsecs_to_cputime(__nsecs) ((__force u64)(__nsecs))
42
43
36/* 44/*
37 * Convert cputime <-> microseconds 45 * Convert cputime <-> microseconds
38 */ 46 */