]> git.hungrycats.org Git - linux/commitdiff
[PATCH] add linux/ioctl32.h header for 2.5.43
authorAndi Kleen <ak@muc.de>
Fri, 18 Oct 2002 13:19:22 +0000 (06:19 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 18 Oct 2002 13:19:22 +0000 (06:19 -0700)
Several ports (x86-64,ppc64,sparc64) which do 32bit ioctl emulation
have functions for drivers to let them define their own translation
handlers. So far it was a bit complicated to use because there
was no standard include file that declares the prototypes for this
stuff. Then drivers and other subsystems can start to declare their own
ioctl translation handlers.

This patch add include/linux/ioctl32.h to fix this.

The actual implementation is in arch specific code. It has been coordinated
with DaveM and Anton.

This patch is needed for the x86-64 merge I sent in separate mail.

There is currently no preprocessor symbol that the drivers can test
to see if they should use this. So far they have to check arch symbols.
This will be fixed later when all 64bit ports that need it add the dynamic
ioctl registration API too (that's ia64,s390x,mips64)

include/linux/ioctl32.h [new file with mode: 0644]

diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
new file mode 100644 (file)
index 0000000..b7abfe6
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef IOCTL32_H
+#define IOCTL32_H 1
+
+struct file;
+
+int sys_ioctl(unsigned int, unsigned int, unsigned long);
+
+/* 
+ * Register an 32bit ioctl translation handler for ioctl cmd.
+ *
+ * handler == NULL: use 64bit ioctl handler.
+ * arguments to handler:  fd: file descriptor
+ *                        cmd: ioctl command.
+ *                        arg: ioctl argument
+ *                        struct file *file: file descriptor pointer.
+ */ 
+
+extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *));
+
+extern int unregister_ioctl32_conversion(unsigned int cmd);
+
+
+#endif