public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Georg Chini <georg.chini@triaton-webhosting.com>
Cc: linux-kernel@vger.kernel.org, Pete Zaitcev <zaitcev@redhat.com>
Subject: Re: Sparc32 - sched_clock missing
Date: Sat, 4 Oct 2003 11:54:55 -0700	[thread overview]
Message-ID: <20031004115455.42d8263e.akpm@osdl.org> (raw)
In-Reply-To: <3F7ED071.7080005@triaton-webhosting.com>

Georg Chini <georg.chini@triaton-webhosting.com> 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);
+}

_


  reply	other threads:[~2003-10-04 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-04 13:51 Sparc32 - sched_clock missing Georg Chini
2003-10-04 18:54 ` Andrew Morton [this message]
2003-10-04 20:20   ` Georg Chini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031004115455.42d8263e.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=georg.chini@triaton-webhosting.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox