diff options
author | Anton Blanchard <anton@samba.org> | 2006-01-06 08:49:49 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 23:47:13 -0500 |
commit | 002ec58eb57bac2380f0ed5a4e88121b4bdb32ec (patch) | |
tree | f8ee3f3028e6c316b5e49f296b9283c1f79f42da | |
parent | aed9c6ccb87d96c333bd6ae631d9e90f3b6d7271 (diff) |
[PATCH] ppc64: fix time syscall
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>
-rw-r--r-- | arch/powerpc/kernel/syscalls.c | 28 | ||||
-rw-r--r-- | arch/powerpc/kernel/systbl.S | 2 |
2 files changed, 1 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index 91b93d917b64..ad895c99813b 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
@@ -43,9 +43,6 @@ | |||
43 | #include <asm/time.h> | 43 | #include <asm/time.h> |
44 | #include <asm/unistd.h> | 44 | #include <asm/unistd.h> |
45 | 45 | ||
46 | extern unsigned long wall_jiffies; | ||
47 | |||
48 | |||
49 | /* | 46 | /* |
50 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 47 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
51 | * | 48 | * |
@@ -311,31 +308,6 @@ int sys_olduname(struct oldold_utsname __user *name) | |||
311 | return error? -EFAULT: 0; | 308 | return error? -EFAULT: 0; |
312 | } | 309 | } |
313 | 310 | ||
314 | #ifdef CONFIG_PPC64 | ||
315 | time_t sys64_time(time_t __user * tloc) | ||
316 | { | ||
317 | time_t secs; | ||
318 | time_t usecs; | ||
319 | |||
320 | long tb_delta = tb_ticks_since(tb_last_stamp); | ||
321 | tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy; | ||
322 | |||
323 | secs = xtime.tv_sec; | ||
324 | usecs = (xtime.tv_nsec/1000) + tb_delta / tb_ticks_per_usec; | ||
325 | while (usecs >= USEC_PER_SEC) { | ||
326 | ++secs; | ||
327 | usecs -= USEC_PER_SEC; | ||
328 | } | ||
329 | |||
330 | if (tloc) { | ||
331 | if (put_user(secs,tloc)) | ||
332 | secs = -EFAULT; | ||
333 | } | ||
334 | |||
335 | return secs; | ||
336 | } | ||
337 | #endif | ||
338 | |||
339 | long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, | 311 | long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, |
340 | u32 len_high, u32 len_low) | 312 | u32 len_high, u32 len_low) |
341 | { | 313 | { |
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S index 989f6286991a..65463a1076e8 100644 --- a/arch/powerpc/kernel/systbl.S +++ b/arch/powerpc/kernel/systbl.S | |||
@@ -54,7 +54,7 @@ SYSCALL(link) | |||
54 | SYSCALL(unlink) | 54 | SYSCALL(unlink) |
55 | COMPAT_SYS(execve) | 55 | COMPAT_SYS(execve) |
56 | SYSCALL(chdir) | 56 | SYSCALL(chdir) |
57 | SYSX(sys64_time,compat_sys_time,sys_time) | 57 | COMPAT_SYS(time) |
58 | SYSCALL(mknod) | 58 | SYSCALL(mknod) |
59 | SYSCALL(chmod) | 59 | SYSCALL(chmod) |
60 | SYSCALL(lchown) | 60 | SYSCALL(lchown) |