From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vipin KUMAR Date: Tue, 04 May 2010 07:24:05 +0530 Subject: [U-Boot] [PATCH v2 02/17] change_bit routine defined In-Reply-To: <4BDE0B4B.9050003@bumblecow.com> References: <1272250610-15439-1-git-send-email-vipin.kumar@st.com> <1272250610-15439-2-git-send-email-vipin.kumar@st.com> <1272250610-15439-3-git-send-email-vipin.kumar@st.com> <4BDE0B4B.9050003@bumblecow.com> Message-ID: <4BDF7E3D.8010608@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 5/3/2010 5:01 AM, Tom Rix wrote: > Vipin KUMAR wrote: >> change_bit routine is left implementation dependent until now. >> This routine is now defined for arm platforms in asm-arm/bitops.h >> > > Add a reason on why this change is needed. > Something like > 'mtd/nand/.. needs this to be defined.. > and the new nand driver needs it.. ' > OK. I would expand the commit log to include the above information Regards Vipin > Tom > > >> Signed-off-by: Vipin Kumar >> --- >> 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 270f163..435857b 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); > >