x86: add user_atomic_cmpxchg_inatomic at uaccess.h
authorQiaowei Ren <qiaowei.ren@intel.com>
Sat, 14 Dec 2013 06:25:02 +0000 (14:25 +0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 16 Dec 2013 17:07:57 +0000 (09:07 -0800)
commitf09174c501f8bb259788cc36d5a7aa5b2831fb5e
tree6c38b937005241368a7bd6a01c58b4f181f2a959
parente7d820a5e549b3eb6c3f9467507566565646a669
x86: add user_atomic_cmpxchg_inatomic at uaccess.h

This patch adds user_atomic_cmpxchg_inatomic() to use CMPXCHG
instruction against a user space address.

This generalizes the already existing futex_atomic_cmpxchg_inatomic()
so it can be used in other contexts.  This will be used in the
upcoming support for Intel MPX (Memory Protection Extensions.)

[ hpa: replaced #ifdef inside a macro with IS_ENABLED() ]

Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
Link: http://lkml.kernel.org/r/1387002303-6620-1-git-send-email-qiaowei.ren@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
arch/x86/include/asm/uaccess.h