Skip to contentSkip to conversation

compat_ioctl.c support in 2.6

PATCH Arun Sharma 1 participant 1 message Aug 8, 2003

lore
Share & tools
lore
#0 lore raw

The attached patch (against 2.6) helps IA-32 applications take advantage of the generic 32 bit (fs/compat_ioctl.c) ioctl handlers. Please apply.

-Arun

asm-ia64/uaccess.h +12 -0
Index: include/asm-ia64/uaccess.h
===================================================================
@@ -240,6 +240,18 @@
 	__cu_len;										\
 })
 
+#define __copy_in_user(to, from, size)          \
+        __copy_user((to), (from), (size))
+
+static inline unsigned long
+copy_in_user(void *to, const void *from, unsigned long n)
+{
+        if(likely(access_ok(VERIFY_READ, from, n) &&
+           access_ok(VERIFY_WRITE, to, n)))
+                n = __copy_user(to, from, n);
+        return n;
+}
+
 extern unsigned long __do_clear_user (void *, unsigned long);
 
 #define __clear_user(to,n)			\
asm-ia64/compat.h +1 -1
Index: include/asm-ia64/compat.h
===================================================================
@@ -133,7 +133,7 @@
 compat_alloc_user_space (long len)
 {
 	struct pt_regs *regs = ia64_task_regs(current);
-	return (void *) ((regs->r12 & -16) - len);
+	return (void *) (((regs->r12 & 0xffffffff) & -16) - len);
 }
 
 #endif /* _ASM_IA64_COMPAT_H */
ia64/ia32/ia32_ioctl.c +9 -395

432 lines not on this page · raw message

ia64/ia32/Makefile +2 -0
Index: arch/ia64/ia32/Makefile
===================================================================
@@ -4,3 +4,5 @@
 
 obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \
 	 ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
+
+CFLAGS_ia32_ioctl.o += -Ifs/