aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-29 04:34:18 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-29 04:34:29 -0400
commitf71bb0ac5e85410601b0db29d7b1635345ea61a4 (patch)
tree7c3ef70ef008db87d8b71e5de0632766ecd64d2f /arch
parent7285dd7fd375763bfb8ab1ac9cf3f1206f503c16 (diff)
parenta42548a18866e87092db93b771e6c5b060d78401 (diff)
Merge branch 'timers/posixtimers' into timers/tracing
Merge reason: timer tracepoint patches depend on both branches Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/include/asm/cputime.h1
-rw-r--r--arch/powerpc/include/asm/cputime.h13
-rw-r--r--arch/powerpc/kernel/time.c4
-rw-r--r--arch/s390/include/asm/cputime.h1
4 files changed, 19 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h
index d20b998cb91d..7fa8a8594660 100644
--- a/arch/ia64/include/asm/cputime.h
+++ b/arch/ia64/include/asm/cputime.h
@@ -30,6 +30,7 @@ typedef u64 cputime_t;
30typedef u64 cputime64_t; 30typedef u64 cputime64_t;
31 31
32#define cputime_zero ((cputime_t)0) 32#define cputime_zero ((cputime_t)0)
33#define cputime_one_jiffy jiffies_to_cputime(1)
33#define cputime_max ((~((cputime_t)0) >> 1) - 1) 34#define cputime_max ((~((cputime_t)0) >> 1) - 1)
34#define cputime_add(__a, __b) ((__a) + (__b)) 35#define cputime_add(__a, __b) ((__a) + (__b))
35#define cputime_sub(__a, __b) ((__a) - (__b)) 36#define cputime_sub(__a, __b) ((__a) - (__b))
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h
index f42e623030ee..fa19f3fe05ff 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -18,6 +18,9 @@
18 18
19#ifndef CONFIG_VIRT_CPU_ACCOUNTING 19#ifndef CONFIG_VIRT_CPU_ACCOUNTING
20#include <asm-generic/cputime.h> 20#include <asm-generic/cputime.h>
21#ifdef __KERNEL__
22static inline void setup_cputime_one_jiffy(void) { }
23#endif
21#else 24#else
22 25
23#include <linux/types.h> 26#include <linux/types.h>
@@ -49,6 +52,11 @@ typedef u64 cputime64_t;
49#ifdef __KERNEL__ 52#ifdef __KERNEL__
50 53
51/* 54/*
55 * One jiffy in timebase units computed during initialization
56 */
57extern cputime_t cputime_one_jiffy;
58
59/*
52 * Convert cputime <-> jiffies 60 * Convert cputime <-> jiffies
53 */ 61 */
54extern u64 __cputime_jiffies_factor; 62extern u64 __cputime_jiffies_factor;
@@ -89,6 +97,11 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif)
89 return ct; 97 return ct;
90} 98}
91 99
100static inline void setup_cputime_one_jiffy(void)
101{
102 cputime_one_jiffy = jiffies_to_cputime(1);
103}
104
92static inline cputime64_t jiffies64_to_cputime64(const u64 jif) 105static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
93{ 106{
94 cputime_t ct; 107 cputime_t ct;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index a508388fb87c..5b1657540a7d 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -193,6 +193,8 @@ EXPORT_SYMBOL(__cputime_clockt_factor);
193DEFINE_PER_CPU(unsigned long, cputime_last_delta); 193DEFINE_PER_CPU(unsigned long, cputime_last_delta);
194DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta); 194DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
195 195
196cputime_t cputime_one_jiffy;
197
196static void calc_cputime_factors(void) 198static void calc_cputime_factors(void)
197{ 199{
198 struct div_result res; 200 struct div_result res;
@@ -500,6 +502,7 @@ static int __init iSeries_tb_recal(void)
500 tb_to_xs = divres.result_low; 502 tb_to_xs = divres.result_low;
501 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; 503 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
502 vdso_data->tb_to_xs = tb_to_xs; 504 vdso_data->tb_to_xs = tb_to_xs;
505 setup_cputime_one_jiffy();
503 } 506 }
504 else { 507 else {
505 printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" 508 printk( "Titan recalibrate: FAILED (difference > 4 percent)\n"
@@ -950,6 +953,7 @@ void __init time_init(void)
950 tb_ticks_per_usec = ppc_tb_freq / 1000000; 953 tb_ticks_per_usec = ppc_tb_freq / 1000000;
951 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); 954 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
952 calc_cputime_factors(); 955 calc_cputime_factors();
956 setup_cputime_one_jiffy();
953 957
954 /* 958 /*
955 * Calculate the length of each tick in ns. It will not be 959 * Calculate the length of each tick in ns. It will not be
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 7a3817a656df..24b1244aadb9 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -42,6 +42,7 @@ __div(unsigned long long n, unsigned int base)
42#endif /* __s390x__ */ 42#endif /* __s390x__ */
43 43
44#define cputime_zero (0ULL) 44#define cputime_zero (0ULL)
45#define cputime_one_jiffy jiffies_to_cputime(1)
45#define cputime_max ((~0UL >> 1) - 1) 46#define cputime_max ((~0UL >> 1) - 1)
46#define cputime_add(__a, __b) ((__a) + (__b)) 47#define cputime_add(__a, __b) ((__a) + (__b))
47#define cputime_sub(__a, __b) ((__a) - (__b)) 48#define cputime_sub(__a, __b) ((__a) - (__b))