Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374187
b: refs/heads/master
c: 023796b
h: refs/heads/master
i:
  374185: 68115c9
  374183: 2bcd680
v: v3
  • Loading branch information
Rob Herring committed Apr 11, 2013
1 parent 129d896 commit e20e677
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 7e48c0b9d9ab07c92cd26f167010cd5a50eb0cec
refs/heads/master: 023796b9be3a77481cd5ee0b64a13a55bb0d5df4
18 changes: 13 additions & 5 deletions trunk/arch/arm/kernel/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ static unsigned long arch_timer_read_counter_long(void)
return arch_timer_read_counter();
}

static u32 arch_timer_read_counter_u32(void)
static u32 sched_clock_mult __read_mostly;

static unsigned long long notrace arch_timer_sched_clock(void)
{
return arch_timer_read_counter();
return arch_timer_read_counter() * sched_clock_mult;
}

static struct delay_timer arch_delay_timer;
Expand Down Expand Up @@ -52,10 +54,16 @@ int __init arch_timer_of_register(void)

int __init arch_timer_sched_clock_init(void)
{
if (arch_timer_get_rate() == 0)
u32 arch_timer_rate = arch_timer_get_rate();

if (arch_timer_rate == 0)
return -ENXIO;

setup_sched_clock(arch_timer_read_counter_u32,
32, arch_timer_get_rate());
/* Cache the sched_clock multiplier to save a divide in the hot path. */
sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
sched_clock_func = arch_timer_sched_clock;
pr_info("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n",
arch_timer_rate / 1000, sched_clock_mult);

return 0;
}

0 comments on commit e20e677

Please sign in to comment.