Subject: time(2) for mips64

From: Atsushi Nemoto <[email-masked]>
Date: Thu, 02 Oct 2003 14:45:08 +0900 (JST)

Should mips64 kernel support time(2) system call for n32/n64 ABI?

Both 2.4 and 2.6 kernel define __NR_time and use sys_time.  But
sys_time in kernel/time.c is not 64-bit clean.

We should remove definition of __NR_time from unistd.h (and sys_time
from scall_64.S), or implement local version of sys_time.

Which way to go?
---
Atsushi Nemoto

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Thu, 2 Oct 2003 15:07:20 +0200 (MET DST)

> Should mips64 kernel support time(2) system call for n32/n64 ABI?

 time(2) is obsolete (by gettimeofday(2)) and should be removed for new
implementations.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

---

From: Atsushi Nemoto <[email-masked]>
Date: Thu, 02 Oct 2003 23:41:16 +0900 (JST)

>>>>> On Thu, 2 Oct 2003 15:07:20 +0200 (MET DST), "Maciej W. Rozycki" <[email-masked]> said:

macro>  time(2) is obsolete (by gettimeofday(2)) and should be removed
macro> for new implementations.

Then could you apply these patches?

for 2.4:

diff -ur linux-mips-cvs/arch/mips64/kernel/scall_64.S linux.new/arch/mips64/kernel/scall_64.S
--- linux-mips-cvs/arch/mips64/kernel/scall_64.S	Tue Aug 26 23:41:57 2003
+++ linux.new/arch/mips64/kernel/scall_64.S	Thu Oct  2 23:15:23 2003
@@ -326,7 +326,7 @@
 	PTR	sys_lremovexattr		/* 5190 */
 	PTR	sys_fremovexattr
 	PTR	sys_tkill
-	PTR	sys_time
+	PTR	sys_ni_syscall
 	PTR	sys_ni_syscall			/* res. for futex */
 	PTR	sys_ni_syscall			/* 5195 rs. sched_setaffinity */
 	PTR	sys_ni_syscall			/* res. f. sched_getaffinity */
diff -ur linux-mips-cvs/arch/mips64/kernel/scall_n32.S linux.new/arch/mips64/kernel/scall_n32.S
--- linux-mips-cvs/arch/mips64/kernel/scall_n32.S	Tue Aug 26 23:41:58 2003
+++ linux.new/arch/mips64/kernel/scall_n32.S	Thu Oct  2 23:15:40 2003
@@ -326,7 +326,7 @@
 	PTR	sys_lremovexattr		/* 6190 */
 	PTR	sys_fremovexattr
 	PTR	sys_tkill
-	PTR	sys_time
+	PTR	sys_ni_syscall
 	PTR	sys_ni_syscall			/* res. for futex */
 	PTR	sys_ni_syscall			/* 6195 rs. sched_setaffinity */
 	PTR	sys_ni_syscall			/* res. f. sched_getaffinity */
diff -ur linux-mips-cvs/include/asm-mips64/unistd.h linux.new/include/asm-mips64/unistd.h
--- linux-mips-cvs/include/asm-mips64/unistd.h	Wed Sep 17 23:22:41 2003
+++ linux.new/include/asm-mips64/unistd.h	Thu Oct  2 23:13:19 2003
@@ -461,7 +461,7 @@
 #define __NR_lremovexattr		(__NR_Linux + 190)
 #define __NR_fremovexattr		(__NR_Linux + 191)
 #define __NR_tkill			(__NR_Linux + 192)
-#define __NR_time			(__NR_Linux + 193)
+#define __NR_unused193			(__NR_Linux + 193)
 #define __NR_futex			(__NR_Linux + 194)
 #define __NR_sched_setaffinity		(__NR_Linux + 195)
 #define __NR_sched_getaffinity		(__NR_Linux + 196)

And for 2.6:

diff -ur linux-mips-2.6-cvs/arch/mips/kernel/scall64-64.S linux-2.6.new/arch/mips/kernel/scall64-64.S
--- linux-mips-2.6-cvs/arch/mips/kernel/scall64-64.S	Sun Aug 31 20:14:45 2003
+++ linux-2.6.new/arch/mips/kernel/scall64-64.S	Thu Oct  2 23:21:18 2003
@@ -398,7 +398,7 @@
 	PTR	sys_lremovexattr		/* 5190 */
 	PTR	sys_fremovexattr
 	PTR	sys_tkill
-	PTR	sys_time
+	PTR	sys_ni_syscall
 	PTR	sys_futex
 	PTR	sys_sched_setaffinity		/* 5195 */
 	PTR	sys_sched_getaffinity
diff -ur linux-mips-2.6-cvs/arch/mips/kernel/scall64-n32.S linux-2.6.new/arch/mips/kernel/scall64-n32.S
--- linux-mips-2.6-cvs/arch/mips/kernel/scall64-n32.S	Sun Aug 31 20:14:45 2003
+++ linux-2.6.new/arch/mips/kernel/scall64-n32.S	Thu Oct  2 23:21:55 2003
@@ -303,7 +303,7 @@
 	PTR	sys_lremovexattr		/* 6190 */
 	PTR	sys_fremovexattr
 	PTR	sys_tkill
-	PTR	sys_time
+	PTR	sys_ni_syscall
 	PTR	compat_sys_futex
 	PTR	sys32_sched_setaffinity		/* 6195 */
 	PTR	sys32_sched_getaffinity
diff -ur linux-mips-2.6-cvs/include/asm-mips/unistd.h linux-2.6.new/include/asm-mips/unistd.h
--- linux-mips-2.6-cvs/include/asm-mips/unistd.h	Thu Jul 31 22:55:59 2003
+++ linux-2.6.new/include/asm-mips/unistd.h	Thu Oct  2 23:20:02 2003
@@ -498,7 +498,7 @@
 #define __NR_lremovexattr		(__NR_Linux + 190)
 #define __NR_fremovexattr		(__NR_Linux + 191)
 #define __NR_tkill			(__NR_Linux + 192)
-#define __NR_time			(__NR_Linux + 193)
+#define __NR_reserved193		(__NR_Linux + 193)
 #define __NR_futex			(__NR_Linux + 194)
 #define __NR_sched_setaffinity		(__NR_Linux + 195)
 #define __NR_sched_getaffinity		(__NR_Linux + 196)
@@ -742,7 +742,7 @@
 #define __NR_lremovexattr		(__NR_Linux + 190)
 #define __NR_fremovexattr		(__NR_Linux + 191)
 #define __NR_tkill			(__NR_Linux + 192)
-#define __NR_time			(__NR_Linux + 193)
+#define __NR_reserved193		(__NR_Linux + 193)
 #define __NR_futex			(__NR_Linux + 194)
 #define __NR_sched_setaffinity		(__NR_Linux + 195)
 #define __NR_sched_getaffinity		(__NR_Linux + 196)
---
Atsushi Nemoto

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Fri, 3 Oct 2003 21:20:11 +0200 (MET DST)

> Then could you apply these patches?

 I can, but they need an approval from Ralf.  Ralf, is the change OK?

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Oct 2003 18:37:02 +0200

>  I can, but they need an approval from Ralf.  Ralf, is the change OK? 

Yes, please.

  Ralf