[PATCH] ppc64: fix time syscall
authorAnton Blanchard <anton@samba.org>
Fri, 6 Jan 2006 13:49:49 +0000 (00:49 +1100)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 04:47:13 +0000 (15:47 +1100)
ppc64 has its own version of sys_time. It looks pretty scary, touching
a whole bunch of variables without any locking or memory ordering.

In fact, a recent bugreport has shown it can actually go backwards. Time
to remove it and just use the generic sys_time, which is implemented on
top of do_gettimeofday.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/syscalls.c
arch/powerpc/kernel/systbl.S

index 91b93d917b64aea53aa5ccc54ff8bdfb9c2441b9..ad895c99813be0d5c9fea05244fe79b0ad91b3e1 100644 (file)
@@ -43,9 +43,6 @@
 #include <asm/time.h>
 #include <asm/unistd.h>
 
-extern unsigned long wall_jiffies;
-
-
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
  *
@@ -311,31 +308,6 @@ int sys_olduname(struct oldold_utsname __user *name)
        return error? -EFAULT: 0;
 }
 
-#ifdef CONFIG_PPC64
-time_t sys64_time(time_t __user * tloc)
-{
-       time_t secs;
-       time_t usecs;
-
-       long tb_delta = tb_ticks_since(tb_last_stamp);
-       tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy;
-
-       secs  = xtime.tv_sec;  
-       usecs = (xtime.tv_nsec/1000) + tb_delta / tb_ticks_per_usec;
-       while (usecs >= USEC_PER_SEC) {
-               ++secs;
-               usecs -= USEC_PER_SEC;
-       }
-
-       if (tloc) {
-               if (put_user(secs,tloc))
-                       secs = -EFAULT;
-       }
-
-       return secs;
-}
-#endif
-
 long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
                      u32 len_high, u32 len_low)
 {
index 989f6286991a9a7aeb0d105b8dbca7d059101a3f..65463a1076e8afc5e3abbe3e17726784ad27fb43 100644 (file)
@@ -54,7 +54,7 @@ SYSCALL(link)
 SYSCALL(unlink)
 COMPAT_SYS(execve)
 SYSCALL(chdir)
-SYSX(sys64_time,compat_sys_time,sys_time)
+COMPAT_SYS(time)
 SYSCALL(mknod)
 SYSCALL(chmod)
 SYSCALL(lchown)