Re: [slubllv5 07/25] x86: Add support for cmpxchg_double

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/26/2011 02:45 PM, Eric Dumazet wrote:
>>
>> "+m" (*ptr) please...
>>
>> 	-hpa
> 
> Oh well, I guess I was fooled by :
> 
>  (arch/x86/include/asm/cmpxchg_32.h)
> 
> static inline void set_64bit(volatile u64 *ptr, u64 value)
> {
>         u32 low  = value;
>         u32 high = value >> 32;
>         u64 prev = *ptr;
> 
>         asm volatile("\n1:\t"
>                      LOCK_PREFIX "cmpxchg8b %0\n\t"
>                      "jnz 1b"
>                      : "=m" (*ptr), "+A" (prev)
>                      : "b" (low), "c" (high)
>                      : "memory");
> }
> 

That's =m because the operation implemented by the asm() statement as a
whole is an assignment; the memory location after the entire asm()
statement has executed does not depend on the input value.

	-hpa

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]