Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105606
b: refs/heads/master
c: 5bed10a
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Siewior authored and Greg Ungerer committed Jul 23, 2008
1 parent 4259146 commit cee622f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95469bd64a7a9ab405b566deb8c81d4aaf67ed9e
refs/heads/master: 5bed10a5ee272fbf18ce0ce764245bbb8f28e2e6
16 changes: 16 additions & 0 deletions trunk/arch/m68knommu/platform/coldfire/dma_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,19 @@ static int __init init_cf_dt_clocksource(void)
}

arch_initcall(init_cf_dt_clocksource);

#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
#define CYC2NS_SCALE ((1000000 << CYC2NS_SCALE_FACTOR) / (DMA_FREQ / 1000))

static unsigned long long cycles2ns(unsigned long cycl)
{
return (unsigned long long) ((unsigned long long)cycl *
CYC2NS_SCALE) >> CYC2NS_SCALE_FACTOR;
}

unsigned long long sched_clock(void)
{
unsigned long cycl = __raw_readl(DTCN0);

return cycles2ns(cycl);
}

0 comments on commit cee622f

Please sign in to comment.