On Fri, Mar 24, 2017 at 07:00:25PM +0100, Peter Zijlstra wrote:
> static inline bool try_cmpxchg2(unsigned int *ptr, unsigned int *val, 
> unsigned int new)
> {
>       unsigned int old = *val;
>       bool success;
> 
>         asm volatile goto("lock cmpxchgl %[new], %[ptr]; "
>                           "jnz %[label]"
>                      : /* no output */
>                      : [ptr] "+m" (*ptr),
>                        [old] "+a" (old)
>                        [new] "r" (new)
>                      : "memory"
>                      : label);
>         return 1;
> 
> label:
>       *val = old;
>       return 0;
> }

N/m, I'm apparently so tired I didn't see the compiler errors :/

Reply via email to