All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Remis Lima Baima <remis.developer@googlemail.com>
Subject: [PATCH 09/15] asm-generic: make bitops.h usable
Date: Wed, 13 May 2009 22:56:32 +0000	[thread overview]
Message-ID: <1242255398-23779-10-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1242255398-23779-1-git-send-email-arnd@arndb.de>

bitops.h apparently suffered from some level of bitrot, it
was missing the smp_mb__{before,after}_clear_bit functions,
and included other headers in an invalid order.

This changes the file so that new architectures can use
it out of the box.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
---
 include/asm-generic/bitops.h |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index c9f369c..a54f442 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -1,19 +1,29 @@
-#ifndef _ASM_GENERIC_BITOPS_H_
-#define _ASM_GENERIC_BITOPS_H_
+#ifndef __ASM_GENERIC_BITOPS_H
+#define __ASM_GENERIC_BITOPS_H
 
 /*
  * For the benefit of those who are trying to port Linux to another
  * architecture, here are some C-language equivalents.  You should
  * recode these in the native assembly language, if at all possible.
- * 
+ *
  * C language equivalents written by Theodore Ts'o, 9/26/92
  */
 
-#include <asm-generic/bitops/atomic.h>
-#include <asm-generic/bitops/non-atomic.h>
+#include <linux/irqflags.h>
+#include <linux/compiler.h>
+
+/*
+ * clear_bit may not imply a memory barrier
+ */
+#ifndef smp_mb__before_clear_bit
+#define smp_mb__before_clear_bit()	smp_mb()
+#define smp_mb__after_clear_bit()	smp_mb()
+#endif
+
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/ffz.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/find.h>
 
@@ -26,8 +36,10 @@
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
 
+#include <asm-generic/bitops/atomic.h>
+#include <asm-generic/bitops/non-atomic.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 
-#endif /* _ASM_GENERIC_BITOPS_H */
+#endif /* __ASM_GENERIC_BITOPS_H */
-- 
1.6.0.4

  parent reply	other threads:[~2009-05-13 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 22:56 [PATCH 00/16] asm-generic headers, v4 Arnd Bergmann
2009-05-13 22:56 ` [PATCH 01/15] asm-generic: rename termios.h, signal.h and mman.h Arnd Bergmann
2009-05-14  5:11   ` Stephen Rothwell
2009-05-14  6:16     ` Sam Ravnborg
2009-05-14  6:43       ` Stephen Rothwell
2009-05-13 22:56 ` [PATCH 02/15] asm-generic: introduce asm/bitsperlong.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 03/15] asm-generic: add generic sysv ipc headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 04/15] asm-generic: add generic ABI headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 05/15] asm-generic: add a generic unistd.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 06/15] asm-generic: rename atomic.h to atomic-long.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 07/15] asm-generic: rename page.h and uaccess.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 08/15] asm-generic: make pci.h usable directly Arnd Bergmann
2009-05-13 22:56 ` Arnd Bergmann [this message]
2009-05-13 22:56 ` [PATCH 10/15] asm-generic: add generic versions of common headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 11/15] asm-generic: add legacy I/O header files Arnd Bergmann
2009-05-13 22:56 ` [PATCH 12/15] asm-generic: add generic atomic.h and io.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 13/15] asm-generic: add generic NOMMU versions of some headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 14/15] asm-generic: add a generic uaccess.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 15/15] add generic lib/checksum.c Arnd Bergmann
2009-05-14  6:45 ` [PATCH 00/16] asm-generic headers, v4 Stephen Rothwell
2009-05-14  7:28   ` Arnd Bergmann
2009-05-14  7:48     ` Stephen Rothwell

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=1242255398-23779-10-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=remis.developer@googlemail.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.