From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
zippel@linux-m68k.org, torvalds@osdl.org, geert@linux-m68k.org,
linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] m68k: fix cmpxchg compile errors if CONFIG_RMW_INSNS=n
Date: Wed, 8 Mar 2006 12:24:27 +0100 [thread overview]
Message-ID: <20060308112427.GD4006@stusta.de> (raw)
In-Reply-To: <20060304122848.188430e8.akpm@osdl.org>
On Sat, Mar 04, 2006 at 12:28:48PM -0800, Andrew Morton wrote:
> Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> >
> > Roman Zippel wrote:
> > > Hi,
> > >
> > > On Fri, 3 Mar 2006, Andrew Morton wrote:
> > >
> > >
> > >>Yes, we now require cmpxchg of all architectures.
> > >
> > >
> > > Actually I'd prefer if we used atomic_cmpxchg() instead.
> > > The cmpxchg() emulation was never added for a good reason - to keep code
> > > from assuming it can be used it for userspace synchronisation. Using an
> > > atomic_t here would probably get at least some attention.
> > >
> >
> > Yes, I guess that's what Andrew meant. The reason we can require
> > atomic_cmpxchg of all architectures is because it is only guaranteed
> > to work on atomic_t.
> >
> > Glad to hear it won't be a problem for you though.
> >
>
> Could someone with an m68k compiler please send the patch?
It's below.
cu
Adrian
<-- snip -->
This patch provides a cmpxchg() if CONFIG_RMW_INSNS=n (code stolen from
m68knommu).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
include/asm-m68k/system.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- linux-2.6.16-rc5-mm3-m68k/include/asm-m68k/system.h.old 2006-03-08 12:10:48.000000000 +0100
+++ linux-2.6.16-rc5-mm3-m68k/include/asm-m68k/system.h 2006-03-08 12:17:47.000000000 +0100
@@ -192,6 +192,21 @@
#define cmpxchg(ptr,o,n)\
((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
(unsigned long)(n),sizeof(*(ptr))))
+
+#else
+
+static inline unsigned long cmpxchg(volatile int *p, int old, int new)
+{
+ unsigned long flags;
+ int prev;
+
+ local_irq_save(flags);
+ if ((prev = *p) == old)
+ *p = new;
+ local_irq_restore(flags);
+ return(prev);
+}
+
#endif
#define arch_align_stack(x) (x)
next prev parent reply other threads:[~2006-03-08 11:24 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-27 5:27 Linux v2.6.16-rc5 Linus Torvalds
2006-02-27 5:51 ` Jeff Garzik
2006-02-27 6:21 ` Randy.Dunlap
2006-02-27 6:52 ` Jeff Garzik
2006-02-27 8:13 ` Paul Rolland
2006-02-27 18:04 ` Francois Romieu
2006-02-27 18:38 ` Jeff Garzik
2006-02-27 22:24 ` Pull request for 'for-jeff' branch Francois Romieu
2006-02-27 6:13 ` 2.6.16-rc5: known regressions Adrian Bunk
2006-02-27 6:26 ` Ryan Phillips
2006-02-27 6:39 ` Vojtech Pavlik
2006-02-27 9:14 ` 2.6.16-rc5: known regressions (ps2 mouse/keyboard issues) Duncan
2006-02-27 6:54 ` 2.6.16-rc5: known regressions Jeff Garzik
2006-02-27 7:08 ` Adrian Bunk
2006-02-28 9:40 ` Jens Axboe
2006-03-01 0:17 ` Randy.Dunlap
2006-03-04 13:18 ` Adrian Bunk
2006-02-27 13:36 ` Mark Lord
2006-02-27 14:09 ` Pavel Machek
2006-03-02 14:00 ` [v4l-dvb-maintainer] " Mauro Carvalho Chehab
2006-03-04 13:27 ` Adrian Bunk
2006-03-04 13:39 ` Mauro Carvalho Chehab
[not found] ` <6dd519ae0603080313o4e7b8a61h5002125c33a0e008@mail.gmail.com>
2006-03-08 20:29 ` Mauro Carvalho Chehab
2006-03-08 22:52 ` Hartmut Hackmann
2006-02-27 7:28 ` Linux v2.6.16-rc5 Dave Jones
2006-02-27 11:20 ` Jens Axboe
2006-02-27 22:42 ` Neil Brown
2006-02-27 7:42 ` Dave Jones
2006-02-27 9:28 ` Nick Piggin
2006-02-27 19:52 ` Rene Herman
2006-02-27 22:51 ` Andrew Morton
2006-02-27 23:32 ` Rene Herman
2006-02-28 1:05 ` Rene Herman
2006-02-28 1:12 ` Andrew Morton
2006-02-28 9:38 ` Linux v2.6.16-rc5 - regression Peter Hagervall
2006-02-28 10:03 ` Andrew Morton
2006-02-28 11:41 ` Peter Hagervall
2006-02-28 11:49 ` Peter Hagervall
2006-02-28 12:43 ` Linux v2.6.16-rc5 Christoph Hellwig
2006-03-03 16:00 ` Mark Rosenstand
2006-03-03 23:01 ` 2.6.16-rc regression: m68k CONFIG_RMW_INSNS=n compile broken Adrian Bunk
2006-03-03 23:22 ` Linus Torvalds
2006-03-03 23:43 ` Adrian Bunk
2006-03-03 23:59 ` Andrew Morton
2006-03-04 14:01 ` Roman Zippel
2006-03-04 14:12 ` Nick Piggin
2006-03-04 20:28 ` Andrew Morton
2006-03-08 11:24 ` Adrian Bunk [this message]
2006-03-05 14:09 ` Linux v2.6.16-rc5 Olaf Hering
2006-03-05 18:59 ` Olaf Hering
2006-03-05 20:02 ` Linus Torvalds
2006-03-05 20:42 ` Olaf Hering
2006-03-05 21:50 ` Paul Mackerras
2006-03-05 22:22 ` Olaf Hering
2006-03-05 22:44 ` Olaf Hering
2006-03-06 7:48 ` Olaf Hering
2006-03-06 16:48 ` Olaf Hering
2006-03-06 22:20 ` Olaf Hering
2006-03-06 23:02 ` Olaf Hering
2006-03-11 21:59 ` Olaf Hering
2006-03-05 22:03 ` Mathieu Chouquet-Stringer
2006-03-06 2:12 ` Linus Torvalds
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=20060308112427.GD4006@stusta.de \
--to=bunk@stusta.de \
--cc=akpm@osdl.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=torvalds@osdl.org \
--cc=zippel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox