Georg Chini <georg.chini@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello out there,
tried to build Kernel 2.6.0-test6-bk4 on my
sparc32 machine and found that the function
sched_clock is missing in time.c. Can anyone
tell me what I have to put there? Please CC
to me.
This is the minimal version to get you going.
A better implementation would use a higer-resolution counter, if the
hardware has such a thing.
diff -puN arch/sparc/kernel/time.c~sparc32-sched_clock arch/sparc/kernel/time.c
--- 25/arch/sparc/kernel/time.c~sparc32-sched_clock 2003-10-04 11:53:19.000000000 -0700
+++ 25-akpm/arch/sparc/kernel/time.c 2003-10-04 11:53:41.000000000 -0700
@@ -617,3 +617,12 @@ static int set_rtc_mmss(unsigned long no
return -1;
}
}
+
+/*
+ * Returns nanoseconds
+ */
+
+unsigned long long sched_clock(void)
+{
+ return (unsigned long long)jiffies * (1000000000 / HZ);
+}
_