Skip to content

Commit

Permalink
[LIB]: Consolidate _atomic_dec_and_lock()
Browse files Browse the repository at this point in the history
Several implementations were essentialy a common piece of C code using
the cmpxchg() macro.  Put the implementation in one spot that everyone
can share, and convert sparc64 over to using this.

Alpha is the lone arch-specific implementation, which codes up a
special fast path for the common case in order to avoid GP reloading
which a pure C version would require.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Sep 15, 2005
1 parent 4a805e8 commit 4db2ce0
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 396 deletions.
5 changes: 0 additions & 5 deletions arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,6 @@ config IRQBALANCE
The default yes will allow the kernel to do irq load balancing.
Saying no will keep the kernel from doing irq load balancing.

config HAVE_DEC_LOCK
bool
depends on (SMP || PREEMPT) && X86_CMPXCHG
default y

# turning this on wastes a bunch of space.
# Summit needs it only when NUMA is on
config BOOT_IOREMAP
Expand Down
1 change: 0 additions & 1 deletion arch/i386/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
bitops.o

lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
42 changes: 0 additions & 42 deletions arch/i386/lib/dec_and_lock.c

This file was deleted.

5 changes: 0 additions & 5 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ config PREEMPT

source "mm/Kconfig"

config HAVE_DEC_LOCK
bool
depends on (SMP || PREEMPT)
default y

config IA32_SUPPORT
bool "Support for Linux/x86 binaries"
help
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
lib-$(CONFIG_PERFMON) += carta_random.o
lib-$(CONFIG_MD_RAID5) += xor.o
lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o

AFLAGS___divdi3.o =
AFLAGS___udivdi3.o = -DUNSIGNED
Expand Down
42 changes: 0 additions & 42 deletions arch/ia64/lib/dec_and_lock.c

This file was deleted.

5 changes: 0 additions & 5 deletions arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,6 @@ config PREEMPT
Say Y here if you are building a kernel for a desktop, embedded
or real-time system. Say N if you are unsure.

config HAVE_DEC_LOCK
bool
depends on (SMP || PREEMPT)
default n

config SMP
bool "Symmetric multi-processing support"
---help---
Expand Down
4 changes: 0 additions & 4 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config HAVE_DEC_LOCK
bool
default y

#
# Select some configuration options automatically based on user selections.
#
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for MIPS-specific library files..
#

lib-y += csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o \
lib-y += csum_partial_copy.o memcpy.o promlib.o \
strlen_user.o strncpy_user.o strnlen_user.o

obj-y += iomap.o
Expand Down
47 changes: 0 additions & 47 deletions arch/mips/lib/dec_and_lock.c

This file was deleted.

4 changes: 0 additions & 4 deletions arch/ppc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config HAVE_DEC_LOCK
bool
default y

config PPC
bool
default y
Expand Down
2 changes: 1 addition & 1 deletion arch/ppc/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for ppc-specific library files..
#

obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o
obj-y := checksum.o string.o strcase.o div64.o

obj-$(CONFIG_8xx) += rheap.o
obj-$(CONFIG_CPM2) += rheap.o
38 changes: 0 additions & 38 deletions arch/ppc/lib/dec_and_lock.c

This file was deleted.

4 changes: 0 additions & 4 deletions arch/ppc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ config GENERIC_ISA_DMA
bool
default y

config HAVE_DEC_LOCK
bool
default y

config EARLY_PRINTK
bool
default y
Expand Down
2 changes: 1 addition & 1 deletion arch/ppc64/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for ppc64-specific library files..
#

lib-y := checksum.o dec_and_lock.o string.o strcase.o
lib-y := checksum.o string.o strcase.o
lib-y += copypage.o memcpy.o copyuser.o usercopy.o

# Lock primitives are defined as no-ops in include/linux/spinlock.h
Expand Down
47 changes: 0 additions & 47 deletions arch/ppc64/lib/dec_and_lock.c

This file was deleted.

8 changes: 0 additions & 8 deletions arch/sparc64/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ config DEBUG_BOOTMEM
depends on DEBUG_KERNEL
bool "Debug BOOTMEM initialization"

# We have a custom atomic_dec_and_lock() implementation but it's not
# compatible with spinlock debugging so we need to fall back on
# the generic version in that case.
config HAVE_DEC_LOCK
bool
depends on SMP && !DEBUG_SPINLOCK
default y

config MCOUNT
bool
depends on STACK_DEBUG
Expand Down
3 changes: 0 additions & 3 deletions arch/sparc64/kernel/sparc64_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ EXPORT_SYMBOL(atomic64_add);
EXPORT_SYMBOL(atomic64_add_ret);
EXPORT_SYMBOL(atomic64_sub);
EXPORT_SYMBOL(atomic64_sub_ret);
#ifdef CONFIG_SMP
EXPORT_SYMBOL(_atomic_dec_and_lock);
#endif

/* Atomic bit operations. */
EXPORT_SYMBOL(test_and_set_bit);
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc64/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
copy_in_user.o user_fixup.o memmove.o \
mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o

lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o

obj-y += iomap.o
Loading

0 comments on commit 4db2ce0

Please sign in to comment.