From: Andi Kleen This needs all the compat patches I sent earlier applied (compat utimes, compat statfs64, compat posix timers) Just call them from the x86-64 entry code. Also implement the x86-64 specific sys32_timer_create. arch/x86_64/ia32/ia32entry.S | 16 +++++++++++++--- arch/x86_64/ia32/sys_ia32.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff -puN arch/x86_64/ia32/ia32entry.S~compat-x86_64 arch/x86_64/ia32/ia32entry.S --- 25/arch/x86_64/ia32/ia32entry.S~compat-x86_64 2003-08-10 14:50:13.000000000 -0700 +++ 25-akpm/arch/x86_64/ia32/ia32entry.S 2003-08-10 14:50:13.000000000 -0700 @@ -462,11 +462,21 @@ ia32_sys_call_table: .quad sys_epoll_wait .quad sys_remap_file_pages .quad sys_set_tid_address - + .quad sys32_timer_create + .quad compat_timer_settime + .quad compat_timer_gettime + .quad sys_timer_getoverrun + .quad sys_timer_delete + .quad compat_clock_settime + .quad compat_clock_gettime + .quad compat_clock_getres + .quad compat_clock_nanosleep + .quad compat_statfs64 /* statfs64 */ + .quad compat_fstatfs64 /* fstatfs64 */ + .quad sys_tgkill + .quad compat_sys_utimes /* don't forget to change IA32_NR_syscalls */ ia32_syscall_end: .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 .quad ni_syscall .endr - - diff -puN arch/x86_64/ia32/sys_ia32.c~compat-x86_64 arch/x86_64/ia32/sys_ia32.c --- 25/arch/x86_64/ia32/sys_ia32.c~compat-x86_64 2003-08-10 14:50:13.000000000 -0700 +++ 25-akpm/arch/x86_64/ia32/sys_ia32.c 2003-08-10 14:50:13.000000000 -0700 @@ -428,6 +428,8 @@ put_tv32(struct compat_timeval *o, struc return err; } +extern int do_setitimer(int which, struct itimerval *, struct itimerval *); + asmlinkage long sys32_alarm(unsigned int seconds) { @@ -1991,6 +1993,41 @@ asmlinkage long sys32_open(const char * return fd; } +struct sigevent32 { + u32 sigev_value; + u32 sigev_signo; + u32 sigev_notify; + u32 payload[(64 / 4) - 3]; +}; + +extern asmlinkage long +sys_timer_create(clockid_t which_clock, + struct sigevent __user *timer_event_spec, + timer_t __user * created_timer_id); + +long +sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id) +{ + struct sigevent se; + if (se32) { + memset(&se, 0, sizeof(struct sigevent)); + if (get_user(se.sigev_value.sival_int, &se32->sigev_value) || + __get_user(se.sigev_signo, &se32->sigev_signo) || + __get_user(se.sigev_notify, &se32->sigev_notify) || + __copy_from_user(&se._sigev_un._pad, &se32->payload, + sizeof(se32->payload))) + return -EFAULT; + } + if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t))) + return -EFAULT; + + mm_segment_t oldfs = get_fs(); + set_fs(KERNEL_DS); + long err = sys_timer_create(clock, se32 ? &se : NULL, timer_id); + set_fs(oldfs); + + return err; +} long sys32_vm86_warning(void) { _