Skip to contentSkip to conversation

compat_sys_adjtimex

PATCH Arun Sharma 4 participants 7 messages Jun 30, 2004 – Jul 2, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

This system call seems to be duplicated in many architectures. Here's a patch which moves it to kernel/compat.c

We didn't touch ppc64, because it seems to be different. We've tested this on ia64 with LTP.

-Arun

This patch moves sys32_adjtimex in 6 archs to kernel/compat.c.

---
 arch/ia64/ia32/ia32_entry.S        |    2 
 arch/ia64/ia32/sys_ia32.c          |   74 ------------------------------------
 arch/mips/kernel/linux32.c         |   73 -----------------------------------
 arch/mips/kernel/scall64-n32.S     |    2 
 arch/mips/kernel/scall64-o32.S     |    2 
 arch/parisc/kernel/sys_parisc32.c  |   58 ----------------------------
 arch/parisc/kernel/syscall_table.S |    2 
 arch/s390/kernel/compat_linux.c    |   73 -----------------------------------
 arch/s390/kernel/compat_wrapper.S  |    8 +--
 arch/s390/kernel/syscalls.S        |    2 
 arch/sparc64/kernel/sys_sparc32.c  |   73 -----------------------------------
 arch/sparc64/kernel/systbls.S      |    2 
 arch/x86_64/ia32/ia32entry.S       |    2 
 arch/x86_64/ia32/sys_ia32.c        |   76 -------------------------------------
 include/linux/compat.h             |   15 +++++++
 kernel/compat.c                    |   58 ++++++++++++++++++++++++++++
 16 files changed, 84 insertions(+), 438 deletions(-)
arch/ia64/ia32/ia32_entry.S +1 -1
diff -purN linux-2.6.7/arch/ia64/ia32/ia32_entry.S linux-2.6.7-adjtimex/arch/ia64/ia32/ia32_entry.S
@@ -332,7 +332,7 @@ ia32_syscall_table:
 	data8 sys_setdomainname
 	data8 sys32_newuname
 	data8 sys32_modify_ldt
-	data8 sys_ni_syscall	/* adjtimex */
+	data8 compat_sys_adjtimex
 	data8 sys32_mprotect	  /* 125 */
 	data8 compat_sys_sigprocmask
 	data8 sys_ni_syscall	/* create_module */
arch/ia64/ia32/sys_ia32.c +0 -74

78 lines not on this page · raw message

arch/mips/kernel/linux32.c +0 -73

79 lines not on this page · raw message

arch/mips/kernel/scall64-n32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-n32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-n32.S
@@ -271,7 +271,7 @@ EXPORT(sysn32_call_table)
 	PTR	sys_pivot_root
 	PTR	sys32_sysctl
 	PTR	sys_prctl
-	PTR	sys32_adjtimex
+	PTR	compat_sys_adjtimex
 	PTR	compat_sys_setrlimit		/* 6155 */
 	PTR	sys_chroot
 	PTR	sys_sync
arch/mips/kernel/scall64-o32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-o32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-o32.S
@@ -382,7 +382,7 @@ out:	jr	ra
 	sys	sys_setdomainname 2
 	sys	sys32_newuname	1
 	sys	sys_ni_syscall	0	/* sys_modify_ldt */
-	sys	sys32_adjtimex	1
+	sys	compat_sys_adjtimex	1
 	sys	sys_mprotect	3			/* 4125 */
 	sys	compat_sys_sigprocmask	3
 	sys	sys_ni_syscall	0			/* was creat_module */
arch/parisc/kernel/syscall_table.S +1 -1
diff -purN linux-2.6.7/arch/parisc/kernel/syscall_table.S linux-2.6.7-adjtimex/arch/parisc/kernel/syscall_table.S
@@ -207,7 +207,7 @@
 	/* struct sockaddr... */
 	ENTRY_SAME(recvfrom)
 	/* struct timex contains longs */
-	ENTRY_DIFF(adjtimex)
+	ENTRY_COMP(adjtimex)
 	ENTRY_SAME(mprotect)		/* 125 */
 	/* old_sigset_t forced to 32 bits.  Beware glibc sigset_t */
 	ENTRY_COMP(sigprocmask)
arch/parisc/kernel/sys_parisc32.c +0 -58

64 lines not on this page · raw message

arch/s390/kernel/compat_linux.c +0 -73

79 lines not on this page · raw message

arch/s390/kernel/compat_wrapper.S +4 -4
diff -purN linux-2.6.7/arch/s390/kernel/compat_wrapper.S linux-2.6.7-adjtimex/arch/s390/kernel/compat_wrapper.S
@@ -547,10 +547,10 @@ sys32_newuname_wrapper:
 	llgtr	%r2,%r2			# struct new_utsname *
 	jg	s390x_newuname		# branch to system call
 
-	.globl  sys32_adjtimex_wrapper 
-sys32_adjtimex_wrapper:
-	llgtr	%r2,%r2			# struct timex_emu31 *
-	jg	sys32_adjtimex		# branch to system call
+	.globl  compat_sys_adjtimex_wrapper
+compat_sys_adjtimex_wrapper:
+	llgtr	%r2,%r2			# struct compat_timex *
+	jg	compat_sys_adjtimex	# branch to system call
 
 	.globl  sys32_mprotect_wrapper 
 sys32_mprotect_wrapper:
arch/s390/kernel/syscalls.S +1 -1
diff -purN linux-2.6.7/arch/s390/kernel/syscalls.S linux-2.6.7-adjtimex/arch/s390/kernel/syscalls.S
@@ -132,7 +132,7 @@ SYSCALL(sys_clone_glue,sys_clone_glue,sy
 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
 SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
 NI_SYSCALL							/* modify_ldt for i386 */
-SYSCALL(sys_adjtimex,sys_adjtimex,sys32_adjtimex_wrapper)
+SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper)	/* 125 */
 SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
 NI_SYSCALL							/* old "create module" */
arch/sparc64/kernel/sys_sparc32.c +0 -73

79 lines not on this page · raw message

arch/sparc64/kernel/systbls.S +1 -1
diff -purN linux-2.6.7/arch/sparc64/kernel/systbls.S linux-2.6.7-adjtimex/arch/sparc64/kernel/systbls.S
@@ -62,7 +62,7 @@ sys_call_table32:
 /*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
 	.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
 /*210*/	.word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
-	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
+	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, compat_sys_adjtimex
 /*220*/	.word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
 	.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
 /*230*/	.word sys32_select, sys_time, sys_nis_syscall, sys_stime, compat_statfs64
arch/x86_64/ia32/ia32entry.S +1 -1
diff -purN linux-2.6.7/arch/x86_64/ia32/ia32entry.S linux-2.6.7-adjtimex/arch/x86_64/ia32/ia32entry.S
@@ -429,7 +429,7 @@ ia32_sys_call_table:
 	.quad sys_setdomainname
 	.quad sys_uname
 	.quad sys_modify_ldt
-	.quad sys32_adjtimex
+	.quad compat_sys_adjtimex
 	.quad sys32_mprotect		/* 125 */
 	.quad compat_sys_sigprocmask
 	.quad quiet_ni_syscall		/* create_module */
arch/x86_64/ia32/sys_ia32.c +0 -76

82 lines not on this page · raw message

include/linux/compat.h +15 -0
diff -purN linux-2.6.7/include/linux/compat.h linux-2.6.7-adjtimex/include/linux/compat.h
@@ -40,6 +40,19 @@ struct compat_tms {
 	compat_clock_t		tms_cstime;
 };
 
+struct compat_timex {
+	u32 modes;
+	s32 offset, freq, maxerror, esterror;
+	s32 status, constant, precision, tolerance;
+	struct compat_timeval time;
+	s32 tick;
+	s32 ppsfreq, jitter, shift, stabil;
+	s32 jitcnt, calcnt, errcnt, stbcnt;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+};
+
 #define _COMPAT_NSIG_WORDS	(_COMPAT_NSIG / _COMPAT_NSIG_BPW)
 
 typedef struct {
@@ -130,5 +143,7 @@ asmlinkage long compat_sys_select(int n,
 		compat_ulong_t __user *outp, compat_ulong_t __user *exp,
 		struct compat_timeval __user *tvp);
 
+asmlinkage long compat_sys_adjtimex(struct compat_timex *utp)
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
kernel/compat.c +58 -0

64 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · On Wed, 30 Jun 2004 12:03:43 -0700 Arun Sharma <[email protected]> wrote:

This system call seems to be duplicated in many architectures. Here's a patch which moves it to kernel/compat.c

We didn't touch ppc64, because it seems to be different. We've tested this on ia64 with LTP.

PPC64 just wants some kind of callback invoked right after the do_adjtimex() call, it should be possible to provide a "do-nothing" macro in linux/compat.h that ppc can override in asm/compat.h

#2 lore raw
Quoted 6 lines · David S. Miller
Quoted 3 lines · On Wed, 30 Jun 2004 12:03:43 -0700 Arun Sharma <[email protected]> wrote:

This system call seems to be duplicated in many architectures. Here's a patch which moves it to kernel/compat.c

Quoted 6 lines
Quoted 2 lines

We didn't touch ppc64, because it seems to be different. We've tested this on ia64 with LTP.

PPC64 just wants some kind of callback invoked right after the do_adjtimex() call, it should be possible to provide a "do-nothing" macro in linux/compat.h that ppc can override in asm/compat.h

That code we have in ppc64 is about 10 times too clever to be allowed to live. It was basically trying to avoid the overhead of the rwlock back in the days when xtime was protected by an rwlock. Now that we have seqlocks we could (and should :) get rid of it.

Paul.

#3 lore raw
Quoted 10 lines · Paul Mackerras
Quoted 9 lines · David S. Miller
Quoted 5 lines · On Wed, 30 Jun 2004 12:03:43 -0700 Arun Sharma <[email protected]> wrote:

This system call seems to be duplicated in many architectures. Here's a patch which moves it to kernel/compat.c

We didn't touch ppc64, because it seems to be different. We've tested this on ia64 with LTP.

Quoted 8 lines
Quoted 3 lines

PPC64 just wants some kind of callback invoked right after the do_adjtimex() call, it should be possible to provide a "do-nothing" macro in linux/compat.h that ppc can override in asm/compat.h

That code we have in ppc64 is about 10 times too clever to be allowed to live. It was basically trying to avoid the overhead of the rwlock back in the days when xtime was protected by an rwlock. Now that we have seqlocks we could (and should :) get rid of it.

ok, the function has been eliminated from ppc64 as well.

-Arun

This patch moves sys32_adjtimex in 7 archs up to kernel/compat.c.

---
 arch/ia64/ia32/ia32_entry.S        |    2 
 arch/ia64/ia32/sys_ia32.c          |   74 -----------------------------------
 arch/mips/kernel/linux32.c         |   73 -----------------------------------
 arch/mips/kernel/scall64-n32.S     |    2 
 arch/mips/kernel/scall64-o32.S     |    2 
 arch/parisc/kernel/sys_parisc32.c  |   58 ---------------------------
 arch/parisc/kernel/syscall_table.S |    2 
 arch/ppc64/kernel/misc.S           |    2 
 arch/ppc64/kernel/sys_ppc32.c      |   77 -------------------------------------
 arch/s390/kernel/compat_linux.c    |   73 -----------------------------------
 arch/s390/kernel/compat_wrapper.S  |    8 +--
 arch/s390/kernel/syscalls.S        |    2 
 arch/sparc64/kernel/sys_sparc32.c  |   73 -----------------------------------
 arch/sparc64/kernel/systbls.S      |    2 
 arch/x86_64/ia32/ia32entry.S       |    2 
 arch/x86_64/ia32/sys_ia32.c        |   76 ------------------------------------
 include/linux/compat.h             |   15 +++++++
 kernel/compat.c                    |   58 +++++++++++++++++++++++++++
 18 files changed, 85 insertions(+), 516 deletions(-)
arch/ia64/ia32/ia32_entry.S +1 -1
diff -purN linux-2.6.7/arch/ia64/ia32/ia32_entry.S linux-2.6.7-adjtimex/arch/ia64/ia32/ia32_entry.S
@@ -332,7 +332,7 @@ ia32_syscall_table:
 	data8 sys_setdomainname
 	data8 sys32_newuname
 	data8 sys32_modify_ldt
-	data8 sys_ni_syscall	/* adjtimex */
+	data8 compat_sys_adjtimex
 	data8 sys32_mprotect	  /* 125 */
 	data8 compat_sys_sigprocmask
 	data8 sys_ni_syscall	/* create_module */
arch/ia64/ia32/sys_ia32.c +0 -74

78 lines not on this page · raw message

arch/mips/kernel/linux32.c +0 -73

79 lines not on this page · raw message

arch/mips/kernel/scall64-n32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-n32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-n32.S
@@ -271,7 +271,7 @@ EXPORT(sysn32_call_table)
 	PTR	sys_pivot_root
 	PTR	sys32_sysctl
 	PTR	sys_prctl
-	PTR	sys32_adjtimex
+	PTR	compat_sys_adjtimex
 	PTR	compat_sys_setrlimit		/* 6155 */
 	PTR	sys_chroot
 	PTR	sys_sync
arch/mips/kernel/scall64-o32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-o32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-o32.S
@@ -382,7 +382,7 @@ out:	jr	ra
 	sys	sys_setdomainname 2
 	sys	sys32_newuname	1
 	sys	sys_ni_syscall	0	/* sys_modify_ldt */
-	sys	sys32_adjtimex	1
+	sys	compat_sys_adjtimex	1
 	sys	sys_mprotect	3			/* 4125 */
 	sys	compat_sys_sigprocmask	3
 	sys	sys_ni_syscall	0			/* was creat_module */
arch/parisc/kernel/syscall_table.S +1 -1
diff -purN linux-2.6.7/arch/parisc/kernel/syscall_table.S linux-2.6.7-adjtimex/arch/parisc/kernel/syscall_table.S
@@ -207,7 +207,7 @@
 	/* struct sockaddr... */
 	ENTRY_SAME(recvfrom)
 	/* struct timex contains longs */
-	ENTRY_DIFF(adjtimex)
+	ENTRY_COMP(adjtimex)
 	ENTRY_SAME(mprotect)		/* 125 */
 	/* old_sigset_t forced to 32 bits.  Beware glibc sigset_t */
 	ENTRY_COMP(sigprocmask)
arch/parisc/kernel/sys_parisc32.c +0 -58

64 lines not on this page · raw message

arch/ppc64/kernel/misc.S +1 -1
diff -purN linux-2.6.7/arch/ppc64/kernel/misc.S linux-2.6.7-adjtimex/arch/ppc64/kernel/misc.S
@@ -730,7 +730,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_setdomainname
 	.llong .ppc64_newuname
 	.llong .sys_ni_syscall		/* old modify_ldt syscall */
-	.llong .sys32_adjtimex
+	.llong .compat_sys_adjtimex
 	.llong .sys_mprotect		/* 125 */
 	.llong .compat_sys_sigprocmask
 	.llong .sys_ni_syscall		/* old create_module syscall */
arch/ppc64/kernel/sys_ppc32.c +0 -77

83 lines not on this page · raw message

arch/s390/kernel/compat_linux.c +0 -73

79 lines not on this page · raw message

arch/s390/kernel/compat_wrapper.S +4 -4
diff -purN linux-2.6.7/arch/s390/kernel/compat_wrapper.S linux-2.6.7-adjtimex/arch/s390/kernel/compat_wrapper.S
@@ -547,10 +547,10 @@ sys32_newuname_wrapper:
 	llgtr	%r2,%r2			# struct new_utsname *
 	jg	s390x_newuname		# branch to system call
 
-	.globl  sys32_adjtimex_wrapper 
-sys32_adjtimex_wrapper:
-	llgtr	%r2,%r2			# struct timex_emu31 *
-	jg	sys32_adjtimex		# branch to system call
+	.globl  compat_sys_adjtimex_wrapper
+compat_sys_adjtimex_wrapper:
+	llgtr	%r2,%r2			# struct compat_timex *
+	jg	compat_sys_adjtimex	# branch to system call
 
 	.globl  sys32_mprotect_wrapper 
 sys32_mprotect_wrapper:
arch/s390/kernel/syscalls.S +1 -1
diff -purN linux-2.6.7/arch/s390/kernel/syscalls.S linux-2.6.7-adjtimex/arch/s390/kernel/syscalls.S
@@ -132,7 +132,7 @@ SYSCALL(sys_clone_glue,sys_clone_glue,sy
 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
 SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
 NI_SYSCALL							/* modify_ldt for i386 */
-SYSCALL(sys_adjtimex,sys_adjtimex,sys32_adjtimex_wrapper)
+SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper)	/* 125 */
 SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
 NI_SYSCALL							/* old "create module" */
arch/sparc64/kernel/sys_sparc32.c +0 -73

79 lines not on this page · raw message

arch/sparc64/kernel/systbls.S +1 -1
diff -purN linux-2.6.7/arch/sparc64/kernel/systbls.S linux-2.6.7-adjtimex/arch/sparc64/kernel/systbls.S
@@ -62,7 +62,7 @@ sys_call_table32:
 /*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
 	.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
 /*210*/	.word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
-	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
+	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, compat_sys_adjtimex
 /*220*/	.word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
 	.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
 /*230*/	.word sys32_select, sys_time, sys_nis_syscall, sys_stime, compat_statfs64
arch/x86_64/ia32/ia32entry.S +1 -1
diff -purN linux-2.6.7/arch/x86_64/ia32/ia32entry.S linux-2.6.7-adjtimex/arch/x86_64/ia32/ia32entry.S
@@ -429,7 +429,7 @@ ia32_sys_call_table:
 	.quad sys_setdomainname
 	.quad sys_uname
 	.quad sys_modify_ldt
-	.quad sys32_adjtimex
+	.quad compat_sys_adjtimex
 	.quad sys32_mprotect		/* 125 */
 	.quad compat_sys_sigprocmask
 	.quad quiet_ni_syscall		/* create_module */
arch/x86_64/ia32/sys_ia32.c +0 -76

82 lines not on this page · raw message

include/linux/compat.h +15 -0
diff -purN linux-2.6.7/include/linux/compat.h linux-2.6.7-adjtimex/include/linux/compat.h
@@ -40,6 +40,19 @@ struct compat_tms {
 	compat_clock_t		tms_cstime;
 };
 
+struct compat_timex {
+	u32 modes;
+	s32 offset, freq, maxerror, esterror;
+	s32 status, constant, precision, tolerance;
+	struct compat_timeval time;
+	s32 tick;
+	s32 ppsfreq, jitter, shift, stabil;
+	s32 jitcnt, calcnt, errcnt, stbcnt;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+	s32  :32; s32  :32; s32  :32; s32  :32;
+};
+
 #define _COMPAT_NSIG_WORDS	(_COMPAT_NSIG / _COMPAT_NSIG_BPW)
 
 typedef struct {
@@ -130,5 +143,7 @@ asmlinkage long compat_sys_select(int n,
 		compat_ulong_t __user *outp, compat_ulong_t __user *exp,
 		struct compat_timeval __user *tvp);
 
+asmlinkage long compat_sys_adjtimex(struct compat_timex *utp)
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
kernel/compat.c +58 -0

64 lines not on this page · raw message

maintainer
#4 lore raw
Quoted 4 lines · Arun Sharma
include/linux/compat.h +3 -0
+struct compat_timex {
+       u32 modes;
+       s32 offset, freq, maxerror, esterror;

include/linux/compat.h struct compat_tms { · line 55

Quoted 10 lines
include/linux/compat.h +10 -0
+       s32 status, constant, precision, tolerance;
+       struct compat_timeval time;
+       s32 tick;
+       s32 ppsfreq, jitter, shift, stabil;
+       s32 jitcnt, calcnt, errcnt, stbcnt;
+       s32  :32; s32  :32; s32  :32; s32  :32;
+       s32  :32; s32  :32; s32  :32; s32  :32;
+       s32  :32; s32  :32; s32  :32; s32  :32;
+};
+

I'd personally prefer to use type names like compat_ulong_t in the place of u32 when the a member in the original struct is unsigned long.

Review

Quoted 2 lines
(quoted diff) +2 -0
+asmlinkage long compat_sys_adjtimex(struct compat_timex *utp)
+

This is missing a semicolon.

I had done my own version of compat_sys_adjtimex and most of the other sys32_* functions that are worth consolidating some time ago. Unfortunately I never got around to bringing them into a proper patch for for submission. Would you like to have my code so you can finish it?
As an alternative approach I can prepare patches that simply add the compat_sys_* functions and leave it to each arch maintainer to remove their own versions.

	Arnd <><
#5 lore raw

On 7/1/2004 6:02 AM, Arnd Bergmann wrote:

Hi Arnd,

As always, thanks for the review.

[...]

Quoted 3 lines

As an alternative approach I can prepare patches that simply add the compat_sys_* functions and leave it to each arch maintainer to remove their own versions.

Sure, that'd be fine by me.

-Arun

#6 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

I'd personally prefer to use type names like compat_ulong_t in the place of u32 when the a member in the original struct is unsigned long.

Review

Quoted 2 lines
(quoted diff) +2 -0
+asmlinkage long compat_sys_adjtimex(struct compat_timex *utp)
+

This is missing a semicolon.

Updated patch to address these two issues.

-Arun

This patch moves sys32_adjtimex in 7 archs up to kernel/compat.c.

---
 arch/ia64/ia32/ia32_entry.S        |    2 
 arch/ia64/ia32/sys_ia32.c          |   74 -----------------------------------
 arch/mips/kernel/linux32.c         |   73 -----------------------------------
 arch/mips/kernel/scall64-n32.S     |    2 
 arch/mips/kernel/scall64-o32.S     |    2 
 arch/parisc/kernel/sys_parisc32.c  |   58 ---------------------------
 arch/parisc/kernel/syscall_table.S |    2 
 arch/ppc64/kernel/misc.S           |    2 
 arch/ppc64/kernel/sys_ppc32.c      |   77 -------------------------------------
 arch/s390/kernel/compat_linux.c    |   73 -----------------------------------
 arch/s390/kernel/compat_wrapper.S  |    8 +--
 arch/s390/kernel/syscalls.S        |    2 
 arch/sparc64/kernel/sys_sparc32.c  |   73 -----------------------------------
 arch/sparc64/kernel/systbls.S      |    2 
 arch/x86_64/ia32/ia32entry.S       |    2 
 arch/x86_64/ia32/sys_ia32.c        |   76 ------------------------------------
 include/linux/compat.h             |   15 +++++++
 kernel/compat.c                    |   58 +++++++++++++++++++++++++++
 18 files changed, 85 insertions(+), 516 deletions(-)
arch/ia64/ia32/ia32_entry.S +1 -1
diff -purN linux-2.6.7/arch/ia64/ia32/ia32_entry.S linux-2.6.7-adjtimex/arch/ia64/ia32/ia32_entry.S
@@ -332,7 +332,7 @@ ia32_syscall_table:
 	data8 sys_setdomainname
 	data8 sys32_newuname
 	data8 sys32_modify_ldt
-	data8 sys_ni_syscall	/* adjtimex */
+	data8 compat_sys_adjtimex
 	data8 sys32_mprotect	  /* 125 */
 	data8 compat_sys_sigprocmask
 	data8 sys_ni_syscall	/* create_module */
arch/ia64/ia32/sys_ia32.c +0 -74

78 lines not on this page · raw message

arch/mips/kernel/linux32.c +0 -73

79 lines not on this page · raw message

arch/mips/kernel/scall64-n32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-n32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-n32.S
@@ -271,7 +271,7 @@ EXPORT(sysn32_call_table)
 	PTR	sys_pivot_root
 	PTR	sys32_sysctl
 	PTR	sys_prctl
-	PTR	sys32_adjtimex
+	PTR	compat_sys_adjtimex
 	PTR	compat_sys_setrlimit		/* 6155 */
 	PTR	sys_chroot
 	PTR	sys_sync
arch/mips/kernel/scall64-o32.S +1 -1
diff -purN linux-2.6.7/arch/mips/kernel/scall64-o32.S linux-2.6.7-adjtimex/arch/mips/kernel/scall64-o32.S
@@ -382,7 +382,7 @@ out:	jr	ra
 	sys	sys_setdomainname 2
 	sys	sys32_newuname	1
 	sys	sys_ni_syscall	0	/* sys_modify_ldt */
-	sys	sys32_adjtimex	1
+	sys	compat_sys_adjtimex	1
 	sys	sys_mprotect	3			/* 4125 */
 	sys	compat_sys_sigprocmask	3
 	sys	sys_ni_syscall	0			/* was creat_module */
arch/parisc/kernel/syscall_table.S +1 -1
diff -purN linux-2.6.7/arch/parisc/kernel/syscall_table.S linux-2.6.7-adjtimex/arch/parisc/kernel/syscall_table.S
@@ -207,7 +207,7 @@
 	/* struct sockaddr... */
 	ENTRY_SAME(recvfrom)
 	/* struct timex contains longs */
-	ENTRY_DIFF(adjtimex)
+	ENTRY_COMP(adjtimex)
 	ENTRY_SAME(mprotect)		/* 125 */
 	/* old_sigset_t forced to 32 bits.  Beware glibc sigset_t */
 	ENTRY_COMP(sigprocmask)
arch/parisc/kernel/sys_parisc32.c +0 -58

64 lines not on this page · raw message

arch/ppc64/kernel/misc.S +1 -1
diff -purN linux-2.6.7/arch/ppc64/kernel/misc.S linux-2.6.7-adjtimex/arch/ppc64/kernel/misc.S
@@ -730,7 +730,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_setdomainname
 	.llong .ppc64_newuname
 	.llong .sys_ni_syscall		/* old modify_ldt syscall */
-	.llong .sys32_adjtimex
+	.llong .compat_sys_adjtimex
 	.llong .sys_mprotect		/* 125 */
 	.llong .compat_sys_sigprocmask
 	.llong .sys_ni_syscall		/* old create_module syscall */
arch/ppc64/kernel/sys_ppc32.c +0 -77

83 lines not on this page · raw message

arch/s390/kernel/compat_linux.c +0 -73

79 lines not on this page · raw message

arch/s390/kernel/compat_wrapper.S +4 -4
diff -purN linux-2.6.7/arch/s390/kernel/compat_wrapper.S linux-2.6.7-adjtimex/arch/s390/kernel/compat_wrapper.S
@@ -547,10 +547,10 @@ sys32_newuname_wrapper:
 	llgtr	%r2,%r2			# struct new_utsname *
 	jg	s390x_newuname		# branch to system call
 
-	.globl  sys32_adjtimex_wrapper 
-sys32_adjtimex_wrapper:
-	llgtr	%r2,%r2			# struct timex_emu31 *
-	jg	sys32_adjtimex		# branch to system call
+	.globl  compat_sys_adjtimex_wrapper
+compat_sys_adjtimex_wrapper:
+	llgtr	%r2,%r2			# struct compat_timex *
+	jg	compat_sys_adjtimex	# branch to system call
 
 	.globl  sys32_mprotect_wrapper 
 sys32_mprotect_wrapper:
arch/s390/kernel/syscalls.S +1 -1
diff -purN linux-2.6.7/arch/s390/kernel/syscalls.S linux-2.6.7-adjtimex/arch/s390/kernel/syscalls.S
@@ -132,7 +132,7 @@ SYSCALL(sys_clone_glue,sys_clone_glue,sy
 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
 SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
 NI_SYSCALL							/* modify_ldt for i386 */
-SYSCALL(sys_adjtimex,sys_adjtimex,sys32_adjtimex_wrapper)
+SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper)	/* 125 */
 SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
 NI_SYSCALL							/* old "create module" */
arch/sparc64/kernel/sys_sparc32.c +0 -73

79 lines not on this page · raw message

arch/sparc64/kernel/systbls.S +1 -1
diff -purN linux-2.6.7/arch/sparc64/kernel/systbls.S linux-2.6.7-adjtimex/arch/sparc64/kernel/systbls.S
@@ -62,7 +62,7 @@ sys_call_table32:
 /*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
 	.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
 /*210*/	.word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
-	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
+	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, compat_sys_adjtimex
 /*220*/	.word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
 	.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
 /*230*/	.word sys32_select, sys_time, sys_nis_syscall, sys_stime, compat_statfs64
arch/x86_64/ia32/ia32entry.S +1 -1
diff -purN linux-2.6.7/arch/x86_64/ia32/ia32entry.S linux-2.6.7-adjtimex/arch/x86_64/ia32/ia32entry.S
@@ -429,7 +429,7 @@ ia32_sys_call_table:
 	.quad sys_setdomainname
 	.quad sys_uname
 	.quad sys_modify_ldt
-	.quad sys32_adjtimex
+	.quad compat_sys_adjtimex
 	.quad sys32_mprotect		/* 125 */
 	.quad compat_sys_sigprocmask
 	.quad quiet_ni_syscall		/* create_module */
arch/x86_64/ia32/sys_ia32.c +0 -76

82 lines not on this page · raw message

include/linux/compat.h +17 -0
diff -purN linux-2.6.7/include/linux/compat.h linux-2.6.7-adjtimex/include/linux/compat.h
@@ -40,6 +40,21 @@ struct compat_tms {
 	compat_clock_t		tms_cstime;
 };
 
+struct compat_timex {
+	compat_uint_t modes;
+	compat_long_t offset, freq, maxerror, esterror;
+	compat_int_t status;
+	compat_long_t constant, precision, tolerance;
+	struct compat_timeval time;
+	compat_long_t tick, ppsfreq, jitter;
+	compat_int_t shift;
+	compat_long_t stabil;
+	compat_long_t jitcnt, calcnt, errcnt, stbcnt;
+	compat_int_t  :32; compat_int_t  :32; compat_int_t  :32; compat_int_t  :32;
+	compat_int_t  :32; compat_int_t  :32; compat_int_t  :32; compat_int_t  :32;
+	compat_int_t  :32; compat_int_t  :32; compat_int_t  :32; compat_int_t  :32;
+};
+
 #define _COMPAT_NSIG_WORDS	(_COMPAT_NSIG / _COMPAT_NSIG_BPW)
 
 typedef struct {
@@ -130,5 +145,7 @@ asmlinkage long compat_sys_select(int n,
 		compat_ulong_t __user *outp, compat_ulong_t __user *exp,
 		struct compat_timeval __user *tvp);
 
+asmlinkage long compat_sys_adjtimex(struct compat_timex *utp);
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
kernel/compat.c +58 -0

64 lines not on this page · raw message