]> err.no Git - linux-2.6/commitdiff
[ARM] Provide basic printk_clock() implementation
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 8 Jan 2007 19:49:12 +0000 (19:49 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 8 Jan 2007 19:50:03 +0000 (19:50 +0000)
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>
arch/arm/kernel/time.c

index 174cd4900bf937da2c566f09d2ba61ca28fe6cf3..3c8cdcfe8d4a9f72c9ffb3762a72b260be85d73c 100644 (file)
@@ -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;
 
 /*