@@ -39,8 +39,8 @@
#ifndef __ASSEMBLY__
-#include <asm/cmpxchg.h>
#include <asm/fixmap.h>
+#include <linux/atomic.h>
#include <linux/mmdebug.h>
#include <linux/mm_types.h>
#include <linux/sched.h>
@@ -3,7 +3,7 @@
#define __ASM_SYNC_BITOPS_H__
#include <asm/bitops.h>
-#include <asm/cmpxchg.h>
+#include <linux/atomic.h>
/* sync_bitops functions are equivalent to the SMP implementation of the
* original functions, independently from CONFIG_SMP being defined.
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <linux/atomic.h>
#include <linux/extable.h>
#include <linux/signal.h>
#include <linux/mm.h>
@@ -34,7 +35,6 @@
#include <linux/hugetlb.h>
#include <asm/bug.h>
-#include <asm/cmpxchg.h>
#include <asm/cpufeature.h>
#include <asm/exception.h>
#include <asm/debug-monitors.h>
Currently a number of arm64-specific files include <asm/cmpxchg.h> for the definition of the cmpxchg helpers. This works fine today, but won't when we switch over to instrumented atomics, and as noted in Documentation/core-api/atomic_ops.rst: If someone wants to use xchg(), cmpxchg() and their variants, linux/atomic.h should be included rather than asm/cmpxchg.h, unless the code is in arch/* and can take care of itself. ... so let's switch to <linux/atomic.h> for these definitions. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> --- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/include/asm/sync_bitops.h | 2 +- arch/arm64/mm/fault.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.11.0