From: Christopher Hoover Not everyone needs futex support, so it should be optional. This is needed for small platforms. include/linux/futex.h | 2 ++ init/Kconfig | 11 ++++++++++- kernel/Makefile | 3 ++- kernel/compat.c | 5 +++-- kernel/sys.c | 2 ++ 5 files changed, 19 insertions(+), 4 deletions(-) diff -puN init/Kconfig~CONFIG_FUTEX init/Kconfig --- 25/init/Kconfig~CONFIG_FUTEX 2003-05-14 20:30:24.000000000 -0700 +++ 25-akpm/init/Kconfig 2003-05-14 23:17:03.000000000 -0700 @@ -110,7 +110,6 @@ config LOG_BUF_SHIFT endmenu - menu "Loadable module support" config MODULES @@ -182,3 +181,13 @@ config KMOD endmenu +# +# Small kernel support below here. These things don't appear in the menus, +# because they break things. +# + +config FUTEX + bool + default y + + diff -puN kernel/Makefile~CONFIG_FUTEX kernel/Makefile --- 25/kernel/Makefile~CONFIG_FUTEX 2003-05-14 20:30:24.000000000 -0700 +++ 25-akpm/kernel/Makefile 2003-05-14 20:30:24.000000000 -0700 @@ -5,9 +5,10 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ exit.o itimer.o time.o softirq.o resource.o \ sysctl.o capability.o ptrace.o timer.o user.o \ - signal.o sys.o kmod.o workqueue.o futex.o pid.o \ + signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o intermodule.o extable.o params.o posix-timers.o +obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o obj-$(CONFIG_LOCKMETER) += lockmeter.o diff -puN kernel/sys.c~CONFIG_FUTEX kernel/sys.c --- 25/kernel/sys.c~CONFIG_FUTEX 2003-05-14 20:30:24.000000000 -0700 +++ 25-akpm/kernel/sys.c 2003-05-14 20:55:06.000000000 -0700 @@ -228,6 +228,8 @@ cond_syscall(sys_shutdown) cond_syscall(sys_sendmsg) cond_syscall(sys_recvmsg) cond_syscall(sys_socketcall) +cond_syscall(sys_futex) +cond_syscall(compat_sys_futex) static int set_one_prio(struct task_struct *p, int niceval, int error) { diff -puN kernel/compat.c~CONFIG_FUTEX kernel/compat.c --- 25/kernel/compat.c~CONFIG_FUTEX 2003-05-14 20:30:24.000000000 -0700 +++ 25-akpm/kernel/compat.c 2003-05-14 20:30:24.000000000 -0700 @@ -18,6 +18,7 @@ #include #include /* for MAX_SCHEDULE_TIMEOUT */ #include /* for FUTEX_WAIT */ +#include #include @@ -211,8 +212,7 @@ asmlinkage long compat_sys_sigprocmask(i return ret; } -extern long do_futex(unsigned long, int, int, unsigned long); - +#ifdef CONFIG_FUTEX asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val, struct compat_timespec *utime) { @@ -226,6 +226,7 @@ asmlinkage long compat_sys_futex(u32 *ua } return do_futex((unsigned long)uaddr, op, val, timeout); } +#endif asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim); diff -puN include/linux/futex.h~CONFIG_FUTEX include/linux/futex.h --- 25/include/linux/futex.h~CONFIG_FUTEX 2003-05-14 20:30:24.000000000 -0700 +++ 25-akpm/include/linux/futex.h 2003-05-14 20:30:24.000000000 -0700 @@ -8,4 +8,6 @@ extern asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, struct timespec __user *utime); +long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout); + #endif _