diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-07 14:12:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-07 14:12:47 -0800 |
commit | b31023fc24e5c39d246e9c6fc75dba1a2902c1d6 (patch) | |
tree | e89713fbd2769a70271e650aa3e3db5cf59c39a6 /drivers/sbus | |
parent | 1928f8e541245eae933f8c95b64b2bc3683f9661 (diff) | |
download | linux-b31023fc24e5c39d246e9c6fc75dba1a2902c1d6.tar.bz2 |
[SPARC] openprom: implement ->compat_ioctl
implement a compat_ioctl handle in the driver instead of having table
entries in sparc64 ioctl32.c (I plan to get rid of the arch ioctl32.c
file eventually)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus')
-rw-r--r-- | drivers/sbus/char/openprom.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 58ed33749571..5028ac214326 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -39,6 +39,7 @@ #include <linux/slab.h> #include <linux/string.h> #include <linux/miscdevice.h> +#include <linux/smp_lock.h> #include <linux/init.h> #include <linux/fs.h> #include <asm/oplib.h> @@ -565,6 +566,38 @@ static int openprom_ioctl(struct inode * inode, struct file * file, } } +static long openprom_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + long rval = -ENOTTY; + + /* + * SunOS/Solaris only, the NetBSD one's have embedded pointers in + * the arg which we'd need to clean up... + */ + switch (cmd) { + case OPROMGETOPT: + case OPROMSETOPT: + case OPROMNXTOPT: + case OPROMSETOPT2: + case OPROMNEXT: + case OPROMCHILD: + case OPROMGETPROP: + case OPROMNXTPROP: + case OPROMU2P: + case OPROMGETCONS: + case OPROMGETFBNAME: + case OPROMGETBOOTARGS: + case OPROMSETCUR: + case OPROMPCI2NODE: + case OPROMPATH2NODE: + lock_kernel(); + rval = openprom_ioctl(file->f_dentry->d_inode, file, cmd, arg); + lock_kernel(); + break; + } +} + static int openprom_open(struct inode * inode, struct file * file) { DATA *data; |