Skip to content

Commit

Permalink
[ARM] Provide basic printk_clock() implementation
Browse files Browse the repository at this point in the history
Current sched_clock() implementations on ARM cause unbootable kernels
with PRINTK_TIME support enabled.  To avoid this, provide a basic
printk_clock() implementation which avoids sched_clock() being called
before the page tables have been set up.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jan 8, 2007
1 parent 6020dff commit e97126c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/arm/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ unsigned long long __attribute__((weak)) sched_clock(void)
return (unsigned long long)jiffies * (1000000000 / HZ);
}

/*
* An implementation of printk_clock() independent from
* sched_clock(). This avoids non-bootable kernels when
* printk_clock is enabled.
*/
unsigned long long printk_clock(void)
{
return (unsigned long long)(jiffies - INITIAL_JIFFIES) *
(1000000000 / HZ);
}

static unsigned long next_rtc_update;

/*
Expand Down

0 comments on commit e97126c

Please sign in to comment.