Re: Sparc32 - sched_clock missing

From: Andrew Morton
Date: Sat Oct 04 2003 - 13:54:42 EST


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);
+}

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/