diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
commit | c4366889dda8110247be59ca41fddb82951a8c26 (patch) | |
tree | 705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /arch/arm/mach-sa1100/generic.c | |
parent | db2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'arch/arm/mach-sa1100/generic.c')
-rw-r--r-- | arch/arm/mach-sa1100/generic.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 4575f316e141..e510295c2580 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | 21 | ||
22 | #include <asm/div64.h> | 22 | #include <asm/div64.h> |
23 | #include <asm/cnt32_to_63.h> | ||
23 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
25 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
@@ -118,15 +119,21 @@ EXPORT_SYMBOL(cpufreq_get); | |||
118 | 119 | ||
119 | /* | 120 | /* |
120 | * This is the SA11x0 sched_clock implementation. This has | 121 | * This is the SA11x0 sched_clock implementation. This has |
121 | * a resolution of 271ns, and a maximum value of 1165s. | 122 | * a resolution of 271ns, and a maximum value of 32025597s (370 days). |
123 | * | ||
124 | * The return value is guaranteed to be monotonic in that range as | ||
125 | * long as there is always less than 582 seconds between successive | ||
126 | * calls to this function. | ||
127 | * | ||
122 | * ( * 1E9 / 3686400 => * 78125 / 288) | 128 | * ( * 1E9 / 3686400 => * 78125 / 288) |
123 | */ | 129 | */ |
124 | unsigned long long sched_clock(void) | 130 | unsigned long long sched_clock(void) |
125 | { | 131 | { |
126 | unsigned long long v; | 132 | unsigned long long v = cnt32_to_63(OSCR); |
127 | 133 | ||
128 | v = (unsigned long long)OSCR * 78125; | 134 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ |
129 | do_div(v, 288); | 135 | v *= 78125<<1; |
136 | do_div(v, 288<<1); | ||
130 | 137 | ||
131 | return v; | 138 | return v; |
132 | } | 139 | } |