diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/ia32/Makefile x/arch/x86_64/ia32/Makefile --- x-ref/arch/x86_64/ia32/Makefile 2003-03-15 03:24:58.000000000 +0100 +++ x/arch/x86_64/ia32/Makefile 2003-10-02 11:47:21.000000000 +0200 @@ -13,7 +13,7 @@ all: ia32.o O_TARGET := ia32.o obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \ - ia32_binfmt.o fpu32.o socket32.o ptrace32.o ipc32.o + ia32_binfmt.o fpu32.o socket32.o ptrace32.o ipc32.o ia32_addsys.o clean:: diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/ia32/ia32_addsys.c x/arch/x86_64/ia32/ia32_addsys.c --- x-ref/arch/x86_64/ia32/ia32_addsys.c 1970-01-01 01:00:00.000000000 +0100 +++ x/arch/x86_64/ia32/ia32_addsys.c 2003-10-02 11:47:21.000000000 +0200 @@ -0,0 +1,181 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct timespec32 { + u32 tv_sec; + u32 tv_nsec; +}; + +#define u32_to_ptr(x) ((void *)(u64)(x)) + + +int sys_sched_getaffinity(pid_t pid, unsigned int len, unsigned long *new_mask_ptr); +int sys_sched_setaffinity(pid_t pid, unsigned int len, unsigned long *new_mask_ptr); + +/* only works on LE */ +long sys32_sched_setaffinity(pid_t pid, unsigned int len, + unsigned int *new_mask_ptr) +{ + mm_segment_t oldfs = get_fs(); + unsigned long mask; + int err; + if (get_user(mask, new_mask_ptr)) + return -EFAULT; + set_fs(KERNEL_DS); + err = sys_sched_setaffinity(pid,sizeof(mask),&mask); + set_fs(oldfs); + return err; +} + +/* only works on LE */ +long sys32_sched_getaffinity(pid_t pid, unsigned int len, + unsigned int *new_mask_ptr) +{ + mm_segment_t oldfs = get_fs(); + unsigned long mask; + int err; + mask = 0; + set_fs(KERNEL_DS); + err = sys_sched_getaffinity(pid,sizeof(mask),&mask); + set_fs(oldfs); + if (err > 0) + err = put_user((u32)mask, new_mask_ptr); + return err; +} + +extern int sys_futex(unsigned long uaddr, int op, int val, struct timespec *t); + +asmlinkage long +sys32_futex(unsigned long uaddr, int op, int val, struct timespec32 *utime32) +{ + struct timespec t; + mm_segment_t oldfs = get_fs(); + int err; + + if (utime32) { + if (verify_area(VERIFY_READ, utime32, sizeof(*utime32))) + return -EFAULT; + + if (__get_user(t.tv_sec, &utime32->tv_sec) || + __get_user(t.tv_nsec, &utime32->tv_nsec)) + return -EFAULT; + + } + + /* the set_fs is safe because futex doesn't use the seg limit + for valid page checking of uaddr. */ + set_fs(KERNEL_DS); + err = sys_futex(uaddr, op, val, &t); + set_fs(oldfs); + return err; +} + +extern long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx); + +long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p) +{ + long ret; + aio_context_t ctx64; + mm_segment_t oldfs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_io_setup(nr_reqs, &ctx64); + set_fs(oldfs); + /* truncating is ok because it's a user address */ + if (!ret) + ret = put_user((u32)ctx64, ctx32p); + return ret; +} + +asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr, + u32 *iocbpp) +{ + struct kioctx *ctx; + long ret = 0; + int i; + + if (unlikely(nr < 0)) + return -EINVAL; + + if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbpp))))) + return -EFAULT; + + ctx = lookup_ioctx(ctx_id); + if (unlikely(!ctx)) { + pr_debug("EINVAL: io_submit: invalid context id\n"); + return -EINVAL; + } + + for (i=0; i= 0xffffffff || + !access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event))) + return -EFAULT; + if (timeout && (get_user(t.tv_sec, &timeout->tv_sec) || + get_user(t.tv_nsec, &timeout->tv_nsec))) + return -EFAULT; + oldfs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL); + set_fs(oldfs); + + if (timeout) { + if (verify_area(VERIFY_WRITE, timeout, sizeof(struct timespec32)) || + __put_user (t.tv_sec, &timeout->tv_sec) || + __put_user (t.tv_nsec, &timeout->tv_nsec)) + return -EFAULT; + } + return ret; +} diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/ia32/ia32entry.S x/arch/x86_64/ia32/ia32entry.S --- x-ref/arch/x86_64/ia32/ia32entry.S 2003-10-02 00:09:42.000000000 +0200 +++ x/arch/x86_64/ia32/ia32entry.S 2003-10-02 11:47:21.000000000 +0200 @@ -351,7 +351,7 @@ ia32_sys_call_table: .quad sys_madvise .quad sys_getdents64 /* 220 getdents64 */ .quad sys32_fcntl64 - .quad sys_ni_syscall /* tux */ + .quad sys_ni_syscall /* tux - only callable from 64bit */ .quad sys_ni_syscall /* security */ .quad sys_gettid .quad sys_readahead /* 225 */ @@ -369,9 +369,22 @@ ia32_sys_call_table: .quad quiet_ni_syscall /* fremovexattr - 237 */ .quad sys_tkill .quad sys_sendfile64 - .quad quiet_ni_syscall /* futex */ - .quad quiet_ni_syscall /* sched_setaffinity */ - .quad quiet_ni_syscall /* sched_getaffinity */ + .quad sys32_futex /* futex */ + .quad sys32_sched_setaffinity + .quad sys32_sched_getaffinity + .quad sys_ni_syscall /* set_threadarea */ + .quad sys_ni_syscall /* get_threadarea */ + .quad sys32_io_setup /* io_setup */ + .quad sys_io_destroy /* io_destroy */ + .quad sys32_io_getevents /* io_getevents */ + .quad sys32_io_submit /* io_submit */ + .quad sys_io_cancel /* io_cancel */ + .quad sys_ni_syscall /* fadvise64 */ + .quad quiet_ni_syscall /* exit_group */ + .quad sys_ni_syscall /* lookup_dcookie */ + .quad sys_epoll_create + .quad sys_epoll_ctl + .quad sys_epoll_wait ia32_syscall_end: .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 .quad ni_syscall diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-x86_64/ia32_unistd.h x/include/asm-x86_64/ia32_unistd.h --- x-ref/include/asm-x86_64/ia32_unistd.h 2003-06-13 22:07:42.000000000 +0200 +++ x/include/asm-x86_64/ia32_unistd.h 2003-10-02 11:47:21.000000000 +0200 @@ -250,6 +250,6 @@ #define __NR_ia32_sched_setaffinity 241 #define __NR_ia32_sched_getaffinity 242 -#define IA32_NR_syscalls 245 +#define IA32_NR_syscalls 260 #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-x86_64/unistd.h x/include/asm-x86_64/unistd.h --- x-ref/include/asm-x86_64/unistd.h 2003-10-02 11:47:07.000000000 +0200 +++ x/include/asm-x86_64/unistd.h 2003-10-02 11:47:30.000000000 +0200 @@ -424,7 +424,15 @@ __SYSCALL(__NR_putpmsg, sys_ni_syscall) __SYSCALL(__NR_afs_syscall, sys_ni_syscall) #define __NR_tuxcall 184 /* reserved for tux */ +#ifdef CONFIG_TUX +__SYSCALL(__NR_tuxcall, __sys_tux) +#else +#ifdef CONFIG_TUX_MODULE +__SYSCALL(__NR_tuxcall, sys_tux) +#else __SYSCALL(__NR_tuxcall, sys_ni_syscall) +#endif +#endif #define __NR_security 185 /* reserved for security */ __SYSCALL(__NR_security, sys_ni_syscall) @@ -436,51 +444,51 @@ __SYSCALL(__NR_gettid, sys_gettid) __SYSCALL(__NR_readahead, sys_readahead) #define __NR_setxattr 188 -__SYSCALL(__NR_setxattr, sys_ni_syscall) +__SYSCALL(__NR_setxattr, sys_setxattr) #define __NR_lsetxattr 189 -__SYSCALL(__NR_lsetxattr, sys_ni_syscall) +__SYSCALL(__NR_lsetxattr, sys_lsetxattr) #define __NR_fsetxattr 190 -__SYSCALL(__NR_fsetxattr, sys_ni_syscall) +__SYSCALL(__NR_fsetxattr, sys_fsetxattr) #define __NR_getxattr 191 -__SYSCALL(__NR_getxattr, sys_ni_syscall) +__SYSCALL(__NR_getxattr, sys_getxattr) #define __NR_lgetxattr 192 -__SYSCALL(__NR_lgetxattr, sys_ni_syscall) +__SYSCALL(__NR_lgetxattr, sys_lgetxattr) #define __NR_fgetxattr 193 -__SYSCALL(__NR_fgetxattr, sys_ni_syscall) +__SYSCALL(__NR_fgetxattr, sys_fgetxattr) #define __NR_listxattr 194 -__SYSCALL(__NR_listxattr, sys_ni_syscall) +__SYSCALL(__NR_listxattr, sys_listxattr) #define __NR_llistxattr 195 -__SYSCALL(__NR_llistxattr, sys_ni_syscall) +__SYSCALL(__NR_llistxattr, sys_llistxattr) #define __NR_flistxattr 196 -__SYSCALL(__NR_flistxattr, sys_ni_syscall) +__SYSCALL(__NR_flistxattr, sys_flistxattr) #define __NR_removexattr 197 -__SYSCALL(__NR_removexattr, sys_ni_syscall) +__SYSCALL(__NR_removexattr, sys_removexattr) #define __NR_lremovexattr 198 -__SYSCALL(__NR_lremovexattr, sys_ni_syscall) +__SYSCALL(__NR_lremovexattr, sys_lremovexattr) #define __NR_fremovexattr 199 -__SYSCALL(__NR_fremovexattr, sys_ni_syscall) +__SYSCALL(__NR_fremovexattr, sys_fremovexattr) #define __NR_tkill 200 /* 2.5 only */ -__SYSCALL(__NR_tkill, sys_ni_syscall) +__SYSCALL(__NR_tkill, sys_tkill) #define __NR_time 201 __SYSCALL(__NR_time, sys_time64) #define __NR_futex 202 /* 2.5 only */ -__SYSCALL(__NR_futex, sys_ni_syscall) +__SYSCALL(__NR_futex, sys_futex) #define __NR_sched_setaffinity 203 -__SYSCALL(__NR_sched_setaffinity, sys_ni_syscall) +__SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity) #define __NR_sched_getaffinity 204 -__SYSCALL(__NR_sched_getaffinity, sys_ni_syscall) +__SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity) #define __NR_set_thread_area 205 __SYSCALL(__NR_set_thread_area, sys_ni_syscall) #define __NR_io_setup 206 -__SYSCALL(__NR_io_setup, sys_ni_syscall) +__SYSCALL(__NR_io_setup, sys_io_setup) #define __NR_io_destroy 207 -__SYSCALL(__NR_io_destroy, sys_ni_syscall) +__SYSCALL(__NR_io_destroy, sys_io_destroy) #define __NR_io_getevents 208 -__SYSCALL(__NR_io_getevents, sys_ni_syscall) +__SYSCALL(__NR_io_getevents, sys_io_getevents) #define __NR_io_submit 209 -__SYSCALL(__NR_io_submit, sys_ni_syscall) +__SYSCALL(__NR_io_submit, sys_io_submit) #define __NR_io_cancel 210 -__SYSCALL(__NR_io_cancel, sys_ni_syscall) +__SYSCALL(__NR_io_cancel, sys_io_cancel) #define __NR_get_thread_area 211 __SYSCALL(__NR_get_thread_area, sys_ni_syscall) #define __NR_lookup_dcookie 212 @@ -495,12 +503,39 @@ __SYSCALL(__NR_epoll_wait, sys_ni_syscal __SYSCALL(__NR_remap_file_pages, sys_ni_syscall) #define __NR_getdents64 217 __SYSCALL(__NR_getdents64, sys_getdents64) +#define __NR_set_tid_address 218 +__SYSCALL(__NR_set_tid_address, sys_ni_syscall) #define __NR_restart_syscall 219 __SYSCALL(__NR_restart_syscall, sys_ni_syscall) #define __NR_semtimedop 220 __SYSCALL(__NR_semtimedop, sys_semtimedop) - -#define __NR_syscall_max __NR_semtimedop +#define __NR_fadvise64 221 +__SYSCALL(__NR_fadvise64, sys_ni_syscall) +#define __NR_timer_create 222 +__SYSCALL(__NR_timer_create, sys_ni_syscall) +#define __NR_timer_settime 223 +__SYSCALL(__NR_timer_settime, sys_ni_syscall) +#define __NR_timer_gettime 224 +__SYSCALL(__NR_timer_gettime, sys_ni_syscall) +#define __NR_timer_getoverrun 225 +__SYSCALL(__NR_timer_getoverrun, sys_ni_syscall) +#define __NR_timer_delete 226 +__SYSCALL(__NR_timer_delete, sys_ni_syscall) +#define __NR_clock_settime 227 +__SYSCALL(__NR_clock_settime, sys_ni_syscall) +#define __NR_clock_gettime 228 +__SYSCALL(__NR_clock_gettime, sys_ni_syscall) +#define __NR_clock_getres 229 +__SYSCALL(__NR_clock_getres, sys_ni_syscall) +#define __NR_clock_nanosleep 230 +__SYSCALL(__NR_clock_nanosleep, sys_ni_syscall) +#define __NR_exit_group 231 +__SYSCALL(__NR_exit_group, sys_ni_syscall) +#define __NR_epoll_wait 232 +__SYSCALL(__NR_epoll_wait, sys_epoll_wait) +#define __NR_epoll_ctl 233 +__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) +#define __NR_syscall_max __NR_epoll_ctl #ifndef __NO_STUBS