public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Nathan_Lynch@mentor•com (Nathan Lynch)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC/PATCH v2] ARM: vDSO gettimeofday using generic timer architecture
Date: Tue, 11 Feb 2014 10:23:38 -0600	[thread overview]
Message-ID: <52FA4E8A.5010508@mentor.com> (raw)
In-Reply-To: <20140211104553.GD8693@mudshark.cambridge.arm.com>

On 02/11/2014 04:45 AM, Will Deacon wrote:
> On Mon, Feb 10, 2014 at 11:57:19PM +0000, Nathan Lynch wrote:
>>
>> Right, this stuff doesn't appear to be necessary.  Removed the vmap,
>> get_page, and ClearPageReserved calls for v3.
> 
> Can you make the corresponding change for arm64 too, please?

Yes, will do.


>>>> +static long clock_gettime_fallback(clockid_t _clkid, struct timespec *_ts)
>>>> +{
>>>> +	register struct timespec *ts asm("r1") = _ts;
>>>> +	register clockid_t clkid asm("r0") = _clkid;
>>>> +	register long ret asm ("r0");
>>>> +	register long nr asm("r7") = __NR_clock_gettime;
>>>> +
>>>> +	asm("swi #0" : "=r" (ret) : "r" (clkid), "r" (ts), "r" (nr) : "memory");
> 
> Might be worth making this volatile, rather than depend on the use of ret.

Okay.


> Also, placing both _clkid and ret into "r0" worries me slightly -- is GCC
> smart enough to realise that writing to ret kills _clkid?

I pretty much lifted this from an example in the GCC manual:

     register int *p1 asm ("r0") = ...;
     register int *p2 asm ("r1") = ...;
     register int *result asm ("r0");
     asm ("sysint" : "=r" (result) : "0" (p1), "r" (p2));

http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Extended-Asm.html

I guess it doesn't directly answer your concern, but it's an indication
that GCC developers have this use case in mind.

      reply	other threads:[~2014-02-11 16:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 23:05 [RFC/PATCH v2] ARM: vDSO gettimeofday using generic timer architecture Nathan Lynch
2014-02-09 10:20 ` Russell King - ARM Linux
2014-02-10 16:51   ` Steve Capper
2014-02-10 17:12     ` Russell King - ARM Linux
2014-02-11  8:44       ` Steve Capper
2014-02-10 23:57   ` Nathan Lynch
2014-02-11 10:45     ` Will Deacon
2014-02-11 16:23       ` Nathan Lynch [this message]

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=52FA4E8A.5010508@mentor.com \
    --to=nathan_lynch@mentor$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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