All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: Brad Boyer <flar@allandria.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Andreas Schwab <schwab@linux-m68k.org>,
	linux-m68k@vger.kernel.org
Subject: Re: Add private syscalls to support NPTL
Date: Wed, 19 Aug 2009 12:06:35 +0400	[thread overview]
Message-ID: <4A8BB28B.3090203@codesourcery.com> (raw)
In-Reply-To: <20090818234017.GA32464@cynthia.pants.nu>

Brad Boyer wrote:
> On Tue, Aug 18, 2009 at 11:07:26AM +0400, Maxim Kuvyrkov wrote:
>> Brad Boyer wrote:
>>> On Tue, Aug 18, 2009 at 01:48:39AM +0400, Maxim Kuvyrkov wrote:
>>>> +/* This syscall gets its arguments in A0 (mem), A1 (oldval) and
>>>> +   D1 (newval).  */
>>>> +asmlinkage int
>>>> +m68k_sys_atomic_cmpxchg_32(unsigned long newval, int d2, int d3, int d4, 
>>>> int d5,
>>>> +			unsigned long __user *mem, unsigned long oldval)
>>>> +{
>>> Any particular reason for this calling convention? The real CAS instruction
>>> specifically takes two data registers for the two values. It seems more
>>> logical to me to have oldval and newval in data registers and just have
>>> the mem argument in an address register.
>> The reason for this calling convention is to minimize difference in 
>> invokation of the vDSO helper and the syscall.  The helper gets its 
>> arguments in a0 (mem), d0 (oldval) and d1 (newval); in a stub, which is 
>> used when vDSO is not available, one then can do:
>>
>> movel %d0,%a1
>> movel #NR,%d0
>> trap #0
> 
> Then wouldn't it make sense to use %d2 instead of %a1?

Thanks for pointing this out, there's no reason for using %a1 /anymore/. 
  As for the past, %d2 is call-clobbered, so it would've needed saving 
on the stack.

Initially, I planned to argue changing ABI of the vDSO kernel helper to 
allow clobber of %a1, but then decided that it doesn't worth it and that 
it's better to save/restore whatever register a value from %d0 is being 
moved to.

As there's no reasoning for using %a1 anymore, I'll make the syscall 
expect its arguments in %a0(mem), %d1(newval) and %d2(oldval).

--
Maxim K.
CodeSourcery

  reply	other threads:[~2009-08-19  8:06 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 21:48 Add private syscalls to support NPTL Maxim Kuvyrkov
2009-08-17 22:11 ` Andreas Schwab
2009-08-18  7:15   ` Maxim Kuvyrkov
2009-08-18  8:06     ` Andreas Schwab
2009-08-18  8:56       ` Maxim Kuvyrkov
2009-08-18  9:22         ` Geert Uytterhoeven
2009-08-18  9:36           ` Maxim Kuvyrkov
2009-08-18 18:18           ` Andreas Schwab
2009-08-23 20:21           ` Maxim Kuvyrkov
2009-08-25 19:43             ` Maxim Kuvyrkov
2009-08-28 10:51               ` Maxim Kuvyrkov
2009-10-02  9:59                 ` Maxim Kuvyrkov
2009-10-26 15:01                   ` Maxim Kuvyrkov
2009-10-28  1:19                     ` Finn Thain
2009-10-28  6:54                       ` Maxim Kuvyrkov
2009-10-28 16:38                         ` Finn Thain
2009-11-06  8:38                         ` Finn Thain
2009-11-06  8:59                           ` Maxim Kuvyrkov
2009-11-10  4:07                             ` Finn Thain
2009-11-10  4:20                               ` Brad Boyer
2009-11-10 10:51                               ` Maxim Kuvyrkov
2009-11-10 16:11                                 ` Finn Thain
2009-08-17 22:18 ` Andreas Schwab
2009-08-18  7:10   ` Maxim Kuvyrkov
2009-08-18  2:28 ` Brad Boyer
2009-08-18  7:07   ` Maxim Kuvyrkov
2009-08-18 23:40     ` Brad Boyer
2009-08-19  8:06       ` Maxim Kuvyrkov [this message]
2009-08-19  8:35       ` Andreas Schwab
2009-12-07  8:38 ` Maxim Kuvyrkov
2009-12-09 10:25   ` Klaus Kuehnhammer
2009-12-09 11:05     ` Maxim Kuvyrkov
     [not found]       ` <DBFD40BF-19FC-47DF-8A7C-B71261AFBD85@parq.net>
     [not found]         ` <4B1F9492.6030604@codesourcery.com>
2009-12-09 15:44           ` Klaus Kuehnhammer
2009-12-10  9:18             ` Maxim Kuvyrkov
2009-12-11 14:01   ` Geert Uytterhoeven
2009-12-11 16:23     ` Maxim Kuvyrkov
2009-12-17 17:53       ` Maxim Kuvyrkov

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=4A8BB28B.3090203@codesourcery.com \
    --to=maxim@codesourcery.com \
    --cc=flar@allandria.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=schwab@linux-m68k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.