Skip to contentSkip to conversation

sys32_ioctl -> compact_sys_ioctl patches

PATCH Pavel Machek 2 participants 2 messages Mar 18, 2003

lore
Share & tools
lore
#0 lore raw

Hi!

I tried posting ioctl32 patches to Linus several times, and got nothing back.

Patches were tested at x86-64 and sparc64, and general attitude seems to be "anything that gets code out of ioctl32.c is welcome".

Do you think you could try to push them through?

Pavel

%patch
Index: linux-quilt/arch/ia64/ia32/ia32_entry.S

ia64/ia32/ia32_entry.S renamed from ioc/arch/ia64/ia32/ia32_entry.S +1 -1
@@ -252,7 +252,7 @@
 	data8 sys_acct
 	data8 sys_umount	  /* recycled never used phys( */
 	data8 sys32_ni_syscall	  /* old lock syscall holder */
-	data8 sys32_ioctl
+	data8 compat_sys_ioctl
 	data8 sys32_fcntl	  /* 55 */
 	data8 sys32_ni_syscall	  /* old mpx syscall holder */
 	data8 sys_setpgid

Index: linux-quilt/arch/ia64/ia32/ia32_ioctl.c

ia64/ia32/ia32_ioctl.c renamed from ioc/arch/ia64/ia32/ia32_ioctl.c +0 -218

221 lines not on this page · raw message

Index: linux-quilt/arch/mips64/kernel/ioctl32.c

mips64/kernel/ioctl32.c renamed from ioc/arch/mips64/kernel/ioctl32.c +0 -67

70 lines not on this page · raw message

Index: linux-quilt/arch/mips64/kernel/scall_o32.S

mips64/kernel/scall_o32.S renamed from ioc/arch/mips64/kernel/scall_o32.S +1 -1
@@ -287,7 +287,7 @@
 	sys	sys_acct	0
 	sys	sys_umount	2
 	sys	sys_ni_syscall	0
-	sys	sys32_ioctl	3
+	sys	compat_sys_ioctl	3
 	sys	sys32_fcntl	3			/* 4055 */
 	sys	sys_ni_syscall	2
 	sys	sys_setpgid	2

Index: linux-quilt/arch/parisc/kernel/ioctl32.c

parisc/kernel/ioctl32.c renamed from ioc/arch/parisc/kernel/ioctl32.c +0 -143

146 lines not on this page · raw message

Index: linux-quilt/arch/parisc/kernel/syscall.S

parisc/kernel/syscall.S renamed from ioc/arch/parisc/kernel/syscall.S +1 -2
@@ -407,8 +407,7 @@
 	ENTRY_SAME(umount)
 	/* struct sockaddr... */
 	ENTRY_SAME(getpeername)
-	/* This one's a huge ugly mess */
-	ENTRY_DIFF(ioctl)
+	ENTRY_COMP(ioctl)
 	ENTRY_COMP(fcntl)		/* 55 */
 	ENTRY_SAME(socketpair)
 	ENTRY_SAME(setpgid)

Index: linux-quilt/arch/ppc64/kernel/ioctl32.c

ppc64/kernel/ioctl32.c renamed from ioc/arch/ppc64/kernel/ioctl32.c +0 -126

129 lines not on this page · raw message

Index: linux-quilt/arch/ppc64/kernel/misc.S

ppc64/kernel/misc.S renamed from ioc/arch/ppc64/kernel/misc.S +2 -2
@@ -556,8 +556,8 @@
 	.llong .sys_acct
 	.llong .sys32_umount
 	.llong .sys_ni_syscall		/* old lock syscall */
-	.llong .sys32_ioctl
-	.llong .compat_sys_fcntl	/* 55 */
+	.llong .compat_sys_ioctl
+	.llong .compat_sys_fcntl		/* 55 */
 	.llong .sys_ni_syscall		/* old mpx syscall */
 	.llong .sys32_setpgid
 	.llong .sys_ni_syscall		/* old ulimit syscall */

Index: linux-quilt/arch/s390x/kernel/ioctl32.c

s390x/kernel/ioctl32.c renamed from ioc/arch/s390x/kernel/ioctl32.c +0 -110

113 lines not on this page · raw message

Index: linux-quilt/arch/s390x/kernel/wrapper32.S

s390x/kernel/wrapper32.S renamed from ioc/arch/s390x/kernel/wrapper32.S +1 -1
@@ -225,7 +225,7 @@
 	llgfr	%r2,%r2			# unsigned int
 	llgfr	%r3,%r3			# unsigned int
 	llgfr	%r4,%r4			# unsigned int
-	jg	sys32_ioctl		# branch to system call
+	jg	compat_sys_ioctl		# branch to system call
 
 	.globl  compat_sys_fcntl_wrapper 
 compat_sys_fcntl_wrapper:

Index: linux-quilt/arch/sparc64/kernel/ioctl32.c

sparc64/kernel/ioctl32.c renamed from ioc/arch/sparc64/kernel/ioctl32.c +9 -141

172 lines not on this page · raw message

Index: linux-quilt/arch/sparc64/kernel/sparc64_ksyms.c

sparc64/kernel/sparc64_ksyms.c renamed from ioc/arch/sparc64/kernel/sparc64_ksyms.c +2 -2
@@ -90,7 +90,7 @@
 extern int svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
 extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
 extern int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-extern int sys32_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
+extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
 extern long sparc32_open(const char * filename, int flags, int mode);
 extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *));
@@ -325,7 +325,7 @@
 EXPORT_SYMBOL(svr4_setcontext);
 EXPORT_SYMBOL(prom_cpu_nodes);
 EXPORT_SYMBOL(sys_ioctl);
-EXPORT_SYMBOL(sys32_ioctl);
+EXPORT_SYMBOL(compat_sys_ioctl);
 EXPORT_SYMBOL(sparc32_open);
 #endif
 

Index: linux-quilt/arch/sparc64/kernel/sunos_ioctl32.c

sparc64/kernel/sunos_ioctl32.c renamed from ioc/arch/sparc64/kernel/sunos_ioctl32.c +26 -26

135 lines not on this page · raw message

Index: linux-quilt/arch/sparc64/kernel/systbls.S

sparc64/kernel/systbls.S renamed from ioc/arch/sparc64/kernel/systbls.S +1 -1
@@ -29,7 +29,7 @@
 	.word sys_chown, sys_sync, sys_kill, compat_sys_newstat, sys32_sendfile
 /*40*/	.word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
 	.word sys_umount, sys32_setgid16, sys32_getgid16, sys_signal, sys32_geteuid16
-/*50*/	.word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys32_ioctl
+/*50*/	.word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
 	.word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve
 /*60*/	.word sys_umask, sys_chroot, compat_sys_newfstat, sys_fstat64, sys_getpagesize
 	.word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid

Index: linux-quilt/arch/sparc64/solaris/ioctl.c

sparc64/solaris/ioctl.c renamed from ioc/arch/sparc64/solaris/ioctl.c +24 -23

91 lines not on this page · raw message

Index: linux-quilt/arch/sparc64/solaris/timod.c

sparc64/solaris/timod.c renamed from ioc/arch/sparc64/solaris/timod.c +0 -2
@@ -29,8 +29,6 @@
 
 extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, 
 	unsigned long arg);
-extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,
-	u32 arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 
 static spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED;

Index: linux-quilt/arch/x86_64/ia32/ia32_ioctl.c

x86_64/ia32/ia32_ioctl.c renamed from ioc/arch/x86_64/ia32/ia32_ioctl.c +3 -223

245 lines not on this page · raw message

Index: linux-quilt/arch/x86_64/ia32/ia32entry.S

x86_64/ia32/ia32entry.S renamed from ioc/arch/x86_64/ia32/ia32entry.S +1 -1
@@ -254,7 +254,7 @@
 	.quad sys_acct
 	.quad sys_umount			/* new_umount */
 	.quad ni_syscall			/* old lock syscall holder */
-	.quad sys32_ioctl
+	.quad compat_sys_ioctl
 	.quad compat_sys_fcntl64		/* 55 */
 	.quad ni_syscall			/* old mpx syscall holder */
 	.quad sys_setpgid

Index: linux-quilt/fs/compat.c

compat.c renamed from ioc/fs/compat.c +222 -1

241 lines not on this page · raw message

Index: linux-quilt/include/linux/ioctl32.h

linux/ioctl32.h renamed from ioc/include/linux/ioctl32.h +5 -0
@@ -19,5 +19,10 @@
 
 extern int unregister_ioctl32_conversion(unsigned int cmd);
 
+struct ioctl_trans {
+	unsigned long cmd;
+	int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
+	struct ioctl_trans *next;
+};
 
 #endif

%diffstat

 arch/ia64/ia32/ia32_entry.S         |    2 
 arch/ia64/ia32/ia32_ioctl.c         |  218 ----------------------------------
 arch/mips64/kernel/ioctl32.c        |   67 ----------
 arch/mips64/kernel/scall_o32.S      |    2 
 arch/parisc/kernel/ioctl32.c        |  143 ----------------------
 arch/parisc/kernel/syscall.S        |    3 
 arch/ppc64/kernel/ioctl32.c         |  126 --------------------
 arch/ppc64/kernel/misc.S            |    4 
 arch/s390x/kernel/ioctl32.c         |  110 -----------------
 arch/s390x/kernel/wrapper32.S       |    2 
 arch/sparc64/kernel/ioctl32.c       |  150 +----------------------
 arch/sparc64/kernel/sparc64_ksyms.c |    4 
 arch/sparc64/kernel/sunos_ioctl32.c |   52 ++++----
 arch/sparc64/kernel/systbls.S       |    2 
 arch/sparc64/solaris/ioctl.c        |   47 +++----
 arch/sparc64/solaris/timod.c        |    2 
 arch/x86_64/ia32/ia32_ioctl.c       |  226 ------------------------------------
 arch/x86_64/ia32/ia32entry.S        |    2 
 fs/compat.c                         |  223 +++++++++++++++++++++++++++++++++++
 include/linux/ioctl32.h             |    5 
 20 files changed, 299 insertions(+), 1091 deletions(-)
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#1 lore raw
Quoted 3 lines · On Tue, 18 Mar 2003 21:25:24 +0100 Pavel Machek <[email protected]> wrote:

I tried posting ioctl32 patches to Linus several times, and got nothing back.

Linus is busy I guess. I have several patches pending as well.

Quoted 2 lines

Patches were tested at x86-64 and sparc64, and general attitude seems to be "anything that gets code out of ioctl32.c is welcome".

Yeah, I get that as well :-)

Quoted 1 line

Do you think you could try to push them through?

I'll do my best.

Thanks for all the work.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/