hoi :) On Wed, Feb 01, 2006 at 06:02:29PM +0900, Akinobu Mita wrote: > +static __inline__ void set_bit(int nr, volatile unsigned long *addr) > +{ > + unsigned long mask = BITOP_MASK(nr); > + unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); > + unsigned long flags; > + > + _atomic_spin_lock_irqsave(p, flags); > + *p |= mask; > + _atomic_spin_unlock_irqrestore(p, flags); > +} You could even use your new generic non-atomic bitops to implement these -- Martin Waitz
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
- From: Russell King <[email protected]>
- Re: [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
- References:
- [patch 00/44] generic bitops
- From: Akinobu Mita <[email protected]>
- [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
- From: Akinobu Mita <[email protected]>
- [patch 00/44] generic bitops
- Prev by Date: [Announce] sg3_utils-1.19 available
- Next by Date: Re: CD writing in future Linux (stirring up a hornets' nest)
- Previous by thread: [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
- Next by thread: Re: [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
- Index(es):