public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: Define change_bit routine
@ 2012-02-27  9:33 Amit Virdi
  2012-02-28 23:19 ` Albert ARIBAUD
  0 siblings, 1 reply; 3+ messages in thread
From: Amit Virdi @ 2012-02-27  9:33 UTC (permalink / raw)
  To: u-boot

From: Vipin KUMAR <vipin.kumar@st.com>

change_bit routine is left implementation dependent until now.
This routine is now defined for arm platforms in asm-arm/bitops.h

The Flexible Static memory controller driver, placed in
mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller
peripheral from ST. The new driver implements the NAND interface part
of the peripheral.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
---
 arch/arm/include/asm/bitops.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 879e20e..8ce1405 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -29,8 +29,6 @@ extern void set_bit(int nr, volatile void * addr);
 
 extern void clear_bit(int nr, volatile void * addr);
 
-extern void change_bit(int nr, volatile void * addr);
-
 static inline void __change_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = BIT_MASK(nr);
@@ -39,6 +37,15 @@ static inline void __change_bit(int nr, volatile void *addr)
 	*p ^= mask;
 }
 
+static inline void change_bit(int nr, volatile void *addr)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	__change_bit(nr, addr);
+	local_irq_restore(flags);
+}
+
 static inline int __test_and_set_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = BIT_MASK(nr);
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-29  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-27  9:33 [U-Boot] [PATCH] ARM: Define change_bit routine Amit Virdi
2012-02-28 23:19 ` Albert ARIBAUD
2012-02-29  5:21   ` Amit Virdi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox