Generic semaphore implementation
Semaphores are no longer performance-critical, so a generic C implementation is better for maintainability, debuggability and extensibility. Thanks to Peter Zijlstra for fixing the lockdep warning. Thanks to Harvey Harrison for pointing out that the unlikely() was unnecessary. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:

کامیت شده توسط
Matthew Wilcox

والد
e48b3deee4
کامیت
64ac24e738
@@ -19,10 +19,6 @@ config 64BIT
|
||||
bool
|
||||
default n
|
||||
|
||||
config SEMAPHORE_SLEEPERS
|
||||
bool
|
||||
default y
|
||||
|
||||
config 3_LEVEL_PGTABLES
|
||||
bool "Three-level pagetables (EXPERIMENTAL)"
|
||||
default n
|
||||
|
@@ -11,10 +11,6 @@ config RWSEM_GENERIC_SPINLOCK
|
||||
bool
|
||||
default y
|
||||
|
||||
config SEMAPHORE_SLEEPERS
|
||||
bool
|
||||
default y
|
||||
|
||||
config 3_LEVEL_PGTABLES
|
||||
bool
|
||||
default y
|
||||
|
@@ -1,17 +1,5 @@
|
||||
#include "linux/module.h"
|
||||
#include "linux/in6.h"
|
||||
#include "linux/rwsem.h"
|
||||
#include "asm/byteorder.h"
|
||||
#include "asm/delay.h"
|
||||
#include "asm/semaphore.h"
|
||||
#include "asm/uaccess.h"
|
||||
#include "asm/checksum.h"
|
||||
#include "asm/errno.h"
|
||||
|
||||
EXPORT_SYMBOL(__down_failed);
|
||||
EXPORT_SYMBOL(__down_failed_interruptible);
|
||||
EXPORT_SYMBOL(__down_failed_trylock);
|
||||
EXPORT_SYMBOL(__up_wakeup);
|
||||
|
||||
/* Networking helper routines. */
|
||||
EXPORT_SYMBOL(csum_partial);
|
||||
|
@@ -3,7 +3,7 @@ OBJ = built-in.o
|
||||
.S.o:
|
||||
$(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
|
||||
|
||||
OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \
|
||||
OBJS = ptrace.o sigcontext.o checksum.o miscthings.o misc.o \
|
||||
ptrace_user.o sysrq.o
|
||||
|
||||
EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel
|
||||
@@ -20,10 +20,6 @@ ptrace_user.o: ptrace_user.c
|
||||
sigcontext.o: sigcontext.c
|
||||
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
semaphore.c:
|
||||
rm -f $@
|
||||
ln -s $(srctree)/arch/ppc/kernel/$@ $@
|
||||
|
||||
checksum.S:
|
||||
rm -f $@
|
||||
ln -s $(srctree)/arch/ppc/lib/$@ $@
|
||||
@@ -66,4 +62,4 @@ misc.o: misc.S ppc_defs.h
|
||||
$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
|
||||
rm -f asm
|
||||
|
||||
clean-files := $(OBJS) ppc_defs.h checksum.S semaphore.c mk_defs.c
|
||||
clean-files := $(OBJS) ppc_defs.h checksum.S mk_defs.c
|
||||
|
@@ -1,16 +1,5 @@
|
||||
#include "linux/module.h"
|
||||
#include "linux/in6.h"
|
||||
#include "linux/rwsem.h"
|
||||
#include "asm/byteorder.h"
|
||||
#include "asm/semaphore.h"
|
||||
#include "asm/uaccess.h"
|
||||
#include "asm/checksum.h"
|
||||
#include "asm/errno.h"
|
||||
|
||||
EXPORT_SYMBOL(__down_failed);
|
||||
EXPORT_SYMBOL(__down_failed_interruptible);
|
||||
EXPORT_SYMBOL(__down_failed_trylock);
|
||||
EXPORT_SYMBOL(__up_wakeup);
|
||||
#include "asm/string.h"
|
||||
|
||||
/*XXX: we need them because they would be exported by x86_64 */
|
||||
EXPORT_SYMBOL(__memcpy);
|
||||
|
مرجع در شماره جدید
Block a user