diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-01-08 20:49:12 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-01-08 20:50:03 +0100 |
commit | e97126cd9056b3b42cdc862ace2ed66f8026f55b (patch) | |
tree | 9be88dbac72032d8e20cdd9b4034972dba6657ad /arch | |
parent | [ARM] Resolve fuse and direct-IO failures due to missing cache flushes (diff) | |
download | linux-e97126cd9056b3b42cdc862ace2ed66f8026f55b.tar.xz linux-e97126cd9056b3b42cdc862ace2ed66f8026f55b.zip |
[ARM] Provide basic printk_clock() implementation
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/time.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 174cd4900bf9..3c8cdcfe8d4a 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -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; /* |