lkml.org 
[lkml]   [2010]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [cpuops cmpxchg double V1 2/4] x86: this_cpu_cmpxchg_double() support
On 12/14/2010 09:48 AM, Christoph Lameter wrote:
> +
> +/*
> + * Inputs:
> + * %rsi : memory location to compare
> + * %rax : low 64 bits of old value
> + * %rdx : high 64 bits of old value
> + * %rbx : low 64 bits of new value
> + * %rcx : high 64 bits of new value
> + * %al : Operation successful
> + */
> +ENTRY(cmpxchg16b_cpuops_emu)
> +CFI_STARTPROC
> +
> +#
> +# Emulate 'cmpxchg16b %gs:(%rsi)' except we return the result in
> +# al not via the ZF. Caller will access al to get result.
> +#
> +cmpxchg16b_cpuops_emu:
> + pushf
> + cli
> +
> + cmpq %gs:(%rsi), %rax
> + jne not_same
> + cmpq %gs:8(%rsi), %rdx
> + jne not_same
> +
> + movq %rbx, %gs:(%rsi)
> + movq %rcx, %gs:8(%rsi)
> +
> + popf
> + mov $1, %al
> + ret
> +
> + not_same:
> + popf
> + xor %al,%al
> + ret
> +
> +CFI_ENDPROC
> +
> +ENDPROC(cmpxchg16b_cpuops)
> +

NAK on this. This is acceptable for cmpxchg8b only because we don't
support SMP on 486s anymore. x86-64 is another matter...

-hpa


\
 
 \ /
  Last update: 2010-12-15 01:49    [from the cache]
©2003-2011 Jasper Spaans