From: Arnd Bergmann <arnd@arndb.de>
To: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Cc: linux-arch@vger.kernel.org
Subject: Re: PATCH : cmpxchg does not handle int * arguments on LP64
Date: Fri, 18 Jun 2010 15:30:30 +0200 [thread overview]
Message-ID: <201006181530.30338.arnd@arndb.de> (raw)
In-Reply-To: <1276865516.1999.18.camel@localhost.localdomain>
On Friday 18 June 2010, Mathieu Lacage wrote:
> I have been using the asm-generic/system.h header to implement my
> version of arch/xx/include/asm/system.h: it appears that the version of
> cmpxchg defined in this generic header does not handle correctly
> non-long arguments on an LP64 arch.
That looks like a correct observation. It's also true on ILP32
architectures.
I am not sure though if it is actually supposed to operate on other
types, I think there was some disagreement on this in the past.
What code specifically did you find needs to do cmpxchg on non-long
data?
> -
> -#define cmpxchg(ptr, o, n) \
> - ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
> - (unsigned long)(o), \
> - (unsigned long)(n)))
> +#define cmpxchg(ptr, o, n) cmpxchg_local(ptr, o, n)
This seems to match what we have in include/asm-generic/cmpxchg.h.
Maybe the best option would be to include that in asm-generic/system.h.
Nobody so far is using asm-generic/system.h, not even tile, which
uses most of the generic headers. This makes it quite likely that
the file is not correct right now. If you think you can improve it,
go wild.
BTW, what architecture are you working on? Is this something you
plan to submit for inclusion soon?
Arnd
next prev parent reply other threads:[~2010-06-18 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 12:51 PATCH : cmpxchg does not handle int * arguments on LP64 Mathieu Lacage
2010-06-18 13:30 ` Arnd Bergmann [this message]
2010-06-18 14:37 ` Mathieu Lacage
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=201006181530.30338.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=mathieu.lacage@sophia.inria.fr \
/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).