From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([66.187.233.31]:57214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164017AbWLGX6q (ORCPT ); Thu, 7 Dec 2006 18:58:46 -0500 From: David Howells In-Reply-To: <20061207234250.GH1255@flint.arm.linux.org.uk> References: <20061207234250.GH1255@flint.arm.linux.org.uk> <20061207085409.228016a2.akpm@osdl.org> <20061207153138.28408.94099.stgit@warthog.cambridge.redhat.com> <20061207153143.28408.7274.stgit@warthog.cambridge.redhat.com> <639.1165521999@redhat.com> Subject: Re: [PATCH 3/3] WorkStruct: Use direct assignment rather than cmpxchg() Date: Thu, 07 Dec 2006 23:58:23 +0000 Message-ID: <26012.1165535903@redhat.com> Sender: linux-arch-owner@vger.kernel.org To: Russell King Cc: David Howells , Andrew Morton , torvalds@osdl.org, davem@davemloft.com, wli@holomorphy.com, matthew@wil.cx, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org List-ID: Russell King wrote: > Incorrect. pre-v6 ARM bitops for test_and_xxx_bit() all do: > > save and disable irqs > load value > test bit > if not in desired state, alter bit and write it back > restore irqs Hmmm... ARM has two implementations. One in the header files which is what I consulted when writing that email: static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p) { unsigned long flags; unsigned long mask = 1UL << (bit & 31); p += bit >> 5; raw_local_irq_save(flags); *p |= mask; raw_local_irq_restore(flags); } And the other in the libs which does as you say. Why the one in the header file at all? David