Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43412
b: refs/heads/master
c: 752bee1
h: refs/heads/master
v: v3
  • Loading branch information
Nicolas Pitre authored and Russell King committed Dec 7, 2006
1 parent a261a1b commit 98dc660
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f1675c11a0a214855ff6cba23aca239eef7a5fb
refs/heads/master: 752bee178ee107aa3dd87a9aeba970444034c6fb
14 changes: 10 additions & 4 deletions trunk/arch/arm/mach-versatile/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/amba/bus.h>
#include <linux/amba/clcd.h>

#include <asm/cnt32_to_63.h>
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/io.h>
Expand Down Expand Up @@ -228,14 +229,19 @@ void __init versatile_map_io(void)

/*
* This is the Versatile sched_clock implementation. This has
* a resolution of 41.7ns, and a maximum value of about 179s.
* a resolution of 41.7ns, and a maximum value of about 35583 days.
*
* The return value is guaranteed to be monotonic in that range as
* long as there is always less than 89 seconds between successive
* calls to this function.
*/
unsigned long long sched_clock(void)
{
unsigned long long v;
unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER));

v = (unsigned long long)readl(VERSATILE_REFCOUNTER) * 125;
do_div(v, 3);
/* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
v *= 125<<1;
do_div(v, 3<<1);

return v;
}
Expand Down

0 comments on commit 98dc660

Please sign in to comment.