Skip to content

Commit 7c8fc35

Browse files
wildea01ingomolnar
authored andcommitted
locking/atomics/arm64: Replace our atomic/lock bitop implementations with asm-generic
The <asm-generic/bitops/{atomic,lock}.h> implementations are built around the atomic-fetch ops, which we implement efficiently for both LSE and LL/SC systems. Use that instead of our hand-rolled, out-of-line bitops.S. Signed-off-by: Will Deacon <will.deacon@arm.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-9-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 84c6591 commit 7c8fc35

3 files changed

Lines changed: 3 additions & 89 deletions

File tree

‎arch/arm64/include/asm/bitops.h‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,11 @@
1717
#define __ASM_BITOPS_H
1818

1919
#include <linux/compiler.h>
20-
#include <asm/barrier.h>
2120

2221
#ifndef _LINUX_BITOPS_H
2322
#error only <linux/bitops.h> can be included directly
2423
#endif
2524

26-
/*
27-
* Little endian assembly atomic bitops.
28-
*/
29-
extern void set_bit(int nr, volatile unsigned long *p);
30-
extern void clear_bit(int nr, volatile unsigned long *p);
31-
extern void change_bit(int nr, volatile unsigned long *p);
32-
extern int test_and_set_bit(int nr, volatile unsigned long *p);
33-
extern int test_and_clear_bit(int nr, volatile unsigned long *p);
34-
extern int test_and_change_bit(int nr, volatile unsigned long *p);
35-
3625
#include <asm-generic/bitops/builtin-__ffs.h>
3726
#include <asm-generic/bitops/builtin-ffs.h>
3827
#include <asm-generic/bitops/builtin-__fls.h>
@@ -44,8 +33,9 @@ extern int test_and_change_bit(int nr, volatile unsigned long *p);
4433

4534
#include <asm-generic/bitops/sched.h>
4635
#include <asm-generic/bitops/hweight.h>
47-
#include <asm-generic/bitops/lock.h>
4836

37+
#include <asm-generic/bitops/atomic.h>
38+
#include <asm-generic/bitops/lock.h>
4939
#include <asm-generic/bitops/non-atomic.h>
5040
#include <asm-generic/bitops/le.h>
5141

‎arch/arm64/lib/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
lib-y := bitops.o clear_user.o delay.o copy_from_user.o \
2+
lib-y := clear_user.o delay.o copy_from_user.o \
33
copy_to_user.o copy_in_user.o copy_page.o \
44
clear_page.o memchr.o memcpy.o memmove.o memset.o \
55
memcmp.o strcmp.o strncmp.o strlen.o strnlen.o \

‎arch/arm64/lib/bitops.S‎

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)