[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D080FDC.7030005@zytor.com>
Date: Tue, 14 Dec 2010 16:46:20 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Christoph Lameter <cl@...ux.com>
CC: Tejun Heo <tj@...nel.org>, akpm@...ux-foundation.org,
Pekka Enberg <penberg@...helsinki.fi>,
linux-kernel@...r.kernel.org,
Eric Dumazet <eric.dumazet@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists