summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanoj Sarcar <kanoj@engr.sgi.com>2000-06-01 01:20:42 +0000
committerKanoj Sarcar <kanoj@engr.sgi.com>2000-06-01 01:20:42 +0000
commit0c9b84482a485a0233a209182366897df8e59ca0 (patch)
tree6d629592a6e30f4720cd46ef5841b83ce0dd8133
parent7e8d2a85a50bb096a2052c749d8fdcee61c69e93 (diff)
Now that __kernel_clock_t is 64 bits, we need to make sure we have a
32 bit version of the sys_times() call (like sparc64, ia64), else the kernel overwrites user space it is not supposed to. Compilations could not be done because of this.
-rw-r--r--arch/mips64/kernel/linux32.c29
-rw-r--r--arch/mips64/kernel/scall_o32.S2
2 files changed, 30 insertions, 1 deletions
diff --git a/arch/mips64/kernel/linux32.c b/arch/mips64/kernel/linux32.c
index c6487e40a..a26631e3b 100644
--- a/arch/mips64/kernel/linux32.c
+++ b/arch/mips64/kernel/linux32.c
@@ -1307,3 +1307,32 @@ sys32_nanosleep(struct timespec32 *rqtp, struct timespec32 *rmtp)
}
return ret;
}
+
+struct tms32 {
+ int tms_utime;
+ int tms_stime;
+ int tms_cutime;
+ int tms_cstime;
+};
+
+extern asmlinkage long sys_times(struct tms * tbuf);
+asmlinkage long sys32_times(struct tms32 *tbuf)
+{
+ struct tms t;
+ long ret;
+ mm_segment_t old_fs = get_fs();
+ int err;
+
+ set_fs(KERNEL_DS);
+ ret = sys_times(tbuf ? &t : NULL);
+ set_fs(old_fs);
+ if (tbuf) {
+ err = put_user (t.tms_utime, &tbuf->tms_utime);
+ err |= __put_user (t.tms_stime, &tbuf->tms_stime);
+ err |= __put_user (t.tms_cutime, &tbuf->tms_cutime);
+ err |= __put_user (t.tms_cstime, &tbuf->tms_cstime);
+ if (err)
+ ret = -EFAULT;
+ }
+ return ret;
+}
diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S
index d37fa0c2c..cd813a36d 100644
--- a/arch/mips64/kernel/scall_o32.S
+++ b/arch/mips64/kernel/scall_o32.S
@@ -245,7 +245,7 @@ illegal_syscall:
sys sys_rmdir 1 /* 4040 */
sys sys_dup 1
sys sys_pipe 0
- sys sys_times 1
+ sys sys32_times 1
sys sys_ni_syscall 0
sys sys_brk 1 /* 4045 */
sys sys_setgid 1