Russell King <[email protected]> wrote: > Yes you can. Well, you can on ARM at least. Between the load exclusive > you can do anything you like until you hit the store exclusive. How come atomic_set() on arm6 is implemented as: static inline void atomic_set(atomic_t *v, int i) { unsigned long tmp; __asm__ __volatile__("@ atomic_set\n" "1: ldrex %0, [%1]\n" " strex %0, %2, [%1]\n" " teq %0, #0\n" " bne 1b" : "=&r" (tmp) : "r" (&v->counter), "r" (i) : "cc"); } Why LDREX/STREX and not direct assignment? David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Russell King <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Christoph Lameter <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Russell King <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Christoph Lameter <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Russell King <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Nick Piggin <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Russell King <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Nick Piggin <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Russell King <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: David Howells <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- Prev by Date: Segmentation fault on modprobe depca
- Next by Date: [RFC 2.6.19 1/1] fbdev,mm: hecuba/E-Ink fbdev driver v2
- Previous by thread: Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- Next by thread: Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it
- Index(es):