From: Russell King <rmk@arm.linux.org.uk>
To: Luca Barbieri <ldb@ldb.ods.org>
Cc: Linux-Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [2.5] asm-generic/atomic.h and changes to arm, parisc, mips, m68k, sh, cris to use it
Date: Fri, 9 Aug 2002 00:29:58 +0100 [thread overview]
Message-ID: <20020809002958.B20257@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1028842995.1669.70.camel@ldb>; from ldb@ldb.ods.org on Thu, Aug 08, 2002 at 11:43:15PM +0200
On Thu, Aug 08, 2002 at 11:43:15PM +0200, Luca Barbieri wrote:
>...
Please don't do this for ARM.
> -static inline int atomic_dec_and_test(volatile atomic_t *v)
> -{
> - unsigned long flags;
> - int val;
> -
> - local_irq_save(flags);
> - val = v->counter;
> - v->counter = val -= 1;
> - local_irq_restore(flags);
> -
> - return val == 0;
> -}
This C code is carefully optimised to allow the compiler to order things
efficiently.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2002-08-08 23:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 21:43 [PATCH] [2.5] asm-generic/atomic.h and changes to arm, parisc, mips, m68k, sh, cris to use it Luca Barbieri
2002-08-08 21:58 ` Roman Zippel
2002-08-08 22:11 ` Luca Barbieri
2002-08-08 22:27 ` Roman Zippel
2002-08-08 22:40 ` Luca Barbieri
2002-08-08 23:04 ` Roman Zippel
2002-08-09 0:11 ` Alan Cox
2002-08-08 23:09 ` Luca Barbieri
2002-08-09 3:52 ` H. Peter Anvin
2002-08-08 23:45 ` Alan Cox
2002-08-12 11:16 ` David Woodhouse
2002-08-12 12:03 ` Luca Barbieri
2002-08-08 23:29 ` Russell King [this message]
2002-08-09 0:41 ` [PATCH] [2.5] (v2) " Luca Barbieri
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=20020809002958.B20257@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=ldb@ldb.ods.org \
--cc=linux-kernel@vger.kernel.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