From: Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2003@gmx.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] [2.5] include/asm-generic/bitops.h {set,clear}_bit return void
Date: Tue, 15 Apr 2003 19:36:48 +0200 [thread overview]
Message-ID: <3E9C4330.1040906@gmx.net> (raw)
Linus,
{set,clear}_bit for all arches no longer return int, but void.
This patch renames the old generic implementations to
test_and_{set,clear}_bit and adds new-style {set,clear}_bit.
Regards,
Carl-Daniel
===== include/asm-generic/bitops.h 1.2 vs edited =====
--- 1.2/include/asm-generic/bitops.h Fri May 3 02:08:35 2002
+++ edited/include/asm-generic/bitops.h Thu Apr 10 09:12:41 2003
@@ -16,7 +16,31 @@
* C language equivalents written by Theodore Ts'o, 9/26/92
*/
+extern __inline__ void set_bit(int nr,long * addr)
+{
+ int mask;
+
+ addr += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ cli();
+ *addr |= mask;
+ sti();
+ return;
+}
+
+extern __inline__ void clear_bit(int nr, long * addr)
+{
+ int mask;
+
+ addr += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ cli();
+ *addr &= ~mask;
+ sti();
+ return;
+}
+
-extern __inline__ int set_bit(int nr,long * addr)
+extern __inline__ int test_and_set_bit(int nr,long * addr)
{
int mask, retval;
@@ -29,7 +53,7 @@
return retval;
}
-extern __inline__ int clear_bit(int nr, long * addr)
+extern __inline__ int test_and_clear_bit(int nr, long * addr)
{
int mask, retval;
--
Linux scales to much more than 64 CPUs!
See include/linux/smp.h:64
#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
next reply other threads:[~2003-04-15 17:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-15 17:36 Carl-Daniel Hailfinger [this message]
[not found] <20030415174010$3e7e@gated-at.bofh.it>
2003-04-15 20:04 ` [PATCH] [2.5] include/asm-generic/bitops.h {set,clear}_bit return void Arnd Bergmann
2003-04-15 21:27 ` Carl-Daniel Hailfinger
2003-04-15 21:34 ` Robert Love
2003-04-15 22:46 ` Arnd Bergmann
2003-04-23 18:04 ` Pavel Machek
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=3E9C4330.1040906@gmx.net \
--to=c-d.hailfinger.kernel.2003@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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.