linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jamie@jamieiles.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] ARM: imx: Add sched_clock support to i.mx platform
Date: Wed, 30 Mar 2011 09:31:36 +0100	[thread overview]
Message-ID: <20110330083136.GA27368@pulham.picochip.com> (raw)
In-Reply-To: <1301472471-5826-1-git-send-email-Frank.Li@freescale.com>

Hi,

On Wed, Mar 30, 2011 at 04:07:51PM +0800, Frank Li wrote:
> From: Xinyu Chen <xinyu.chen@freescale.com>
> 
> Add sched_clock() implement for i.mx platform to support nanosecond
> resolution time for sched clock used by scheduler.
> 
> Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
> Signed-off-by: Frank Li <Frank.Li@freescale.com>
> ---
>  arch/arm/plat-mxc/time.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
> index 9f0c261..de8a04f 100644
> --- a/arch/arm/plat-mxc/time.c
> +++ b/arch/arm/plat-mxc/time.c
> @@ -123,6 +123,15 @@ static struct clocksource clocksource_mxc = {
>  	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
>  };
>  
> +unsigned long long sched_clock(void)
> +{
> +	if (!timer_base)
> +		return 0;
> +
> +	return clocksource_cyc2ns(clocksource_mxc.read(&clocksource_mxc),
> +			clocksource_mxc.mult, clocksource_mxc.shift);
> +}

sched_clock() should be marked "notrace".  Also, this should use the 
sched_clock support in arch/arm/include/asm/sched_clock.h that takes 
care of wrapping and making it monotonic.

Jamie

  reply	other threads:[~2011-03-30  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  8:07 [PATCH 1/1] ARM: imx: Add sched_clock support to i.mx platform Frank Li
2011-03-30  8:31 ` Jamie Iles [this message]
2011-03-30  8:47 ` Uwe Kleine-König
2011-03-30  8:57 ` Russell King - ARM Linux

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=20110330083136.GA27368@pulham.picochip.com \
    --to=jamie@jamieiles.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).