]> git.baikalelectronics.ru Git - kernel.git/commit
x86, asm: Clean up and simplify set_64bit()
authorH. Peter Anvin <hpa@zytor.com>
Wed, 28 Jul 2010 06:29:52 +0000 (23:29 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 28 Jul 2010 06:29:52 +0000 (23:29 -0700)
commit691aeb97857d53e2a9d1c24ed77387513931d0f2
treeada2b711139dfec0ba6bd820e7840138af4d5bfa
parent32b8920095765251945f7ebd5fc93ea6bfb066e3
x86, asm: Clean up and simplify set_64bit()

Clean up and simplify set_64bit().  This code is quite old (1.3.11)
and contains a fair bit of auxilliary machinery that current versions
of gcc handle just fine automatically.  Worse, the auxilliary
machinery can actually cause an unnecessary spill to memory.

Furthermore, the loading of the old value inside the loop in the
32-bit case is unnecessary: if the value doesn't match, the CMPXCHG8B
instruction will already have loaded the "new previous" value for us.

Clean up the comment, too, and remove page references to obsolete
versions of the Intel SDM.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <tip-*@vger.kernel.org>
arch/x86/include/asm/cmpxchg_32.h
arch/x86/include/asm/cmpxchg_64.h