From patchwork Wed May 16 12:06:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,V3,RESEND,1/4] ARM: Define change_bit routine Date: Wed, 16 May 2012 02:06:13 -0000 From: Amit Virdi X-Patchwork-Id: 159604 Message-Id: <3a0f0bea129713110ae7ab4ade4274e21e722399.1337169928.git.amit.virdi@st.com> To: Cc: scottwood@freescale.com, Amit Virdi , sr@denx.de, spear-devel@list.st.com From: Vipin KUMAR 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 Signed-off-by: Amit Virdi --- 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);