diff options
| -rw-r--r-- | arch/sparc64/kernel/ioctl32.c | 92 | ||||
| -rw-r--r-- | drivers/video/bw2.c | 3 | ||||
| -rw-r--r-- | drivers/video/cg14.c | 3 | ||||
| -rw-r--r-- | drivers/video/cg3.c | 3 | ||||
| -rw-r--r-- | drivers/video/cg6.c | 3 | ||||
| -rw-r--r-- | drivers/video/ffb.c | 3 | ||||
| -rw-r--r-- | drivers/video/leo.c | 3 | ||||
| -rw-r--r-- | drivers/video/p9100.c | 3 | ||||
| -rw-r--r-- | drivers/video/sbuslib.c | 107 | ||||
| -rw-r--r-- | drivers/video/sbuslib.h | 2 | ||||
| -rw-r--r-- | drivers/video/tcx.c | 3 |
11 files changed, 133 insertions, 92 deletions
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index e62214354bb5..196b208665a2 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c | |||
| @@ -12,86 +12,10 @@ | |||
| 12 | #define INCLUDES | 12 | #define INCLUDES |
| 13 | #include "compat_ioctl.c" | 13 | #include "compat_ioctl.c" |
| 14 | #include <linux/syscalls.h> | 14 | #include <linux/syscalls.h> |
| 15 | #include <asm/fbio.h> | ||
| 16 | |||
| 17 | /* Use this to get at 32-bit user passed pointers. | ||
| 18 | * See sys_sparc32.c for description about it. | ||
| 19 | */ | ||
| 20 | #define A(__x) compat_ptr(__x) | ||
| 21 | 15 | ||
| 22 | #define CODE | 16 | #define CODE |
| 23 | #include "compat_ioctl.c" | 17 | #include "compat_ioctl.c" |
| 24 | 18 | ||
| 25 | struct fbcmap32 { | ||
| 26 | int index; /* first element (0 origin) */ | ||
| 27 | int count; | ||
| 28 | u32 red; | ||
| 29 | u32 green; | ||
| 30 | u32 blue; | ||
| 31 | }; | ||
| 32 | |||
| 33 | #define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32) | ||
| 34 | #define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32) | ||
| 35 | |||
| 36 | static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
| 37 | { | ||
| 38 | struct fbcmap32 __user *argp = (void __user *)arg; | ||
| 39 | struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p)); | ||
| 40 | u32 addr; | ||
| 41 | int ret; | ||
| 42 | |||
| 43 | ret = copy_in_user(p, argp, 2 * sizeof(int)); | ||
| 44 | ret |= get_user(addr, &argp->red); | ||
| 45 | ret |= put_user(compat_ptr(addr), &p->red); | ||
| 46 | ret |= get_user(addr, &argp->green); | ||
| 47 | ret |= put_user(compat_ptr(addr), &p->green); | ||
| 48 | ret |= get_user(addr, &argp->blue); | ||
| 49 | ret |= put_user(compat_ptr(addr), &p->blue); | ||
| 50 | if (ret) | ||
| 51 | return -EFAULT; | ||
| 52 | return sys_ioctl(fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (unsigned long)p); | ||
| 53 | } | ||
| 54 | |||
| 55 | struct fbcursor32 { | ||
| 56 | short set; /* what to set, choose from the list above */ | ||
| 57 | short enable; /* cursor on/off */ | ||
| 58 | struct fbcurpos pos; /* cursor position */ | ||
| 59 | struct fbcurpos hot; /* cursor hot spot */ | ||
| 60 | struct fbcmap32 cmap; /* color map info */ | ||
| 61 | struct fbcurpos size; /* cursor bit map size */ | ||
| 62 | u32 image; /* cursor image bits */ | ||
| 63 | u32 mask; /* cursor mask bits */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | #define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32) | ||
| 67 | #define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32) | ||
| 68 | |||
| 69 | static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
| 70 | { | ||
| 71 | struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p)); | ||
| 72 | struct fbcursor32 __user *argp = (void __user *)arg; | ||
| 73 | compat_uptr_t addr; | ||
| 74 | int ret; | ||
| 75 | |||
| 76 | ret = copy_in_user(p, argp, | ||
| 77 | 2 * sizeof (short) + 2 * sizeof(struct fbcurpos)); | ||
| 78 | ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos)); | ||
| 79 | ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int)); | ||
| 80 | ret |= get_user(addr, &argp->cmap.red); | ||
| 81 | ret |= put_user(compat_ptr(addr), &p->cmap.red); | ||
| 82 | ret |= get_user(addr, &argp->cmap.green); | ||
| 83 | ret |= put_user(compat_ptr(addr), &p->cmap.green); | ||
| 84 | ret |= get_user(addr, &argp->cmap.blue); | ||
| 85 | ret |= put_user(compat_ptr(addr), &p->cmap.blue); | ||
| 86 | ret |= get_user(addr, &argp->mask); | ||
| 87 | ret |= put_user(compat_ptr(addr), &p->mask); | ||
| 88 | ret |= get_user(addr, &argp->image); | ||
| 89 | ret |= put_user(compat_ptr(addr), &p->image); | ||
| 90 | if (ret) | ||
| 91 | return -EFAULT; | ||
| 92 | return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p); | ||
| 93 | } | ||
| 94 | |||
| 95 | #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) | 19 | #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) |
| 96 | #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL }, | 20 | #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL }, |
| 97 | #define IOCTL_TABLE_START \ | 21 | #define IOCTL_TABLE_START \ |
| @@ -103,22 +27,6 @@ IOCTL_TABLE_START | |||
| 103 | #include <linux/compat_ioctl.h> | 27 | #include <linux/compat_ioctl.h> |
| 104 | #define DECLARES | 28 | #define DECLARES |
| 105 | #include "compat_ioctl.c" | 29 | #include "compat_ioctl.c" |
| 106 | COMPATIBLE_IOCTL(FBIOGTYPE) | ||
| 107 | COMPATIBLE_IOCTL(FBIOSATTR) | ||
| 108 | COMPATIBLE_IOCTL(FBIOGATTR) | ||
| 109 | COMPATIBLE_IOCTL(FBIOSVIDEO) | ||
| 110 | COMPATIBLE_IOCTL(FBIOGVIDEO) | ||
| 111 | COMPATIBLE_IOCTL(FBIOGCURSOR32) /* This is not implemented yet. Later it should be converted... */ | ||
| 112 | COMPATIBLE_IOCTL(FBIOSCURPOS) | ||
| 113 | COMPATIBLE_IOCTL(FBIOGCURPOS) | ||
| 114 | COMPATIBLE_IOCTL(FBIOGCURMAX) | ||
| 115 | /* Little k */ | ||
| 116 | /* Little v, the video4linux ioctls */ | ||
| 117 | /* And these ioctls need translation */ | ||
| 118 | /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ | ||
| 119 | HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) | ||
| 120 | HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap) | ||
| 121 | HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor) | ||
| 122 | #if 0 | 30 | #if 0 |
| 123 | HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl) | 31 | HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl) |
| 124 | HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl) | 32 | HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl) |
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index f53bf3ba1278..d3728f60961e 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c | |||
| @@ -51,6 +51,9 @@ static struct fb_ops bw2_ops = { | |||
| 51 | .fb_imageblit = cfb_imageblit, | 51 | .fb_imageblit = cfb_imageblit, |
| 52 | .fb_mmap = bw2_mmap, | 52 | .fb_mmap = bw2_mmap, |
| 53 | .fb_ioctl = bw2_ioctl, | 53 | .fb_ioctl = bw2_ioctl, |
| 54 | #ifdef CONFIG_COMPAT | ||
| 55 | .fb_compat_ioctl = sbusfb_compat_ioctl, | ||
| 56 | #endif | ||
| 54 | }; | 57 | }; |
| 55 | 58 | ||
| 56 | /* OBio addresses for the bwtwo registers */ | 59 | /* OBio addresses for the bwtwo registers */ |
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c index 030d4b13b1c2..1bed50f2a276 100644 --- a/drivers/video/cg14.c +++ b/drivers/video/cg14.c | |||
| @@ -49,6 +49,9 @@ static struct fb_ops cg14_ops = { | |||
| 49 | .fb_imageblit = cfb_imageblit, | 49 | .fb_imageblit = cfb_imageblit, |
| 50 | .fb_mmap = cg14_mmap, | 50 | .fb_mmap = cg14_mmap, |
| 51 | .fb_ioctl = cg14_ioctl, | 51 | .fb_ioctl = cg14_ioctl, |
| 52 | #ifdef CONFIG_COMPAT | ||
| 53 | .fb_compat_ioctl = sbusfb_compat_ioctl, | ||
| 54 | #endif | ||
| 52 | }; | 55 | }; |
| 53 | 56 | ||
| 54 | #define CG14_MCR_INTENABLE_SHIFT 7 | 57 | #define CG14_MCR_INTENABLE_SHIFT 7 |
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index b94eee8c42d5..a1354e7e0513 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c | |||
| @@ -50,6 +50,9 @@ static struct fb_ops cg3_ops = { | |||
| 50 | .fb_imageblit = cfb_imageblit, | 50 | .fb_imageblit = cfb_imageblit, |
| 51 | .fb_mmap = cg3_mmap, | 51 | .fb_mmap = cg3_mmap, |
| 52 | .fb_ioctl = cg3_ioctl, | 52 | .fb_ioctl = cg3_ioctl, |
| 53 | #ifdef CONFIG_COMPAT | ||
| 54 | .fb_compat_ioctl = sbusfb_compat_ioctl, | ||
| 55 | #endif | ||
| 53 | }; | 56 | }; |
| 54 | 57 | ||
| 55 | 58 | ||
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c index 414c4409e924..9debe642fd2f 100644 --- a/drivers/video/cg6.c +++ b/drivers/video/cg6.c | |||
| @@ -54,6 +54,9 @@ static struct fb_ops cg6_ops = { | |||
| 54 | .fb_sync = cg6_sync, | 54 | .fb_sync = cg6_sync, |
| 55 | .fb_mmap = cg6_mmap, | 55 | .fb_mmap = cg6_mmap, |
| 56 | .fb_ioctl = cg6_ioctl, | 56 | .fb_ioctl = cg6_ioctl, |
| 57 | #ifdef CONFIG_COMPAT | ||
| 58 | .fb_compat_ioctl = sbusfb_compat_ioctl, | ||
| 59 | #endif | ||
| 57 | }; | 60 | }; |
| 58 | 61 | ||
| 59 | /* Offset of interesting structures in the OBIO space */ | 62 | /* Offset of interesting structures in the OBIO space */ |
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 04417dc16c2e..2584daec7bbf 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c | |||
| @@ -57,6 +57,9 @@ static struct fb_ops ffb_ops = { | |||
| 57 | .fb_sync = ffb_sync, | 57 | .fb_sync = ffb_sync, |
| 58 | .fb_mmap = ffb_mmap, | 58 | .fb_mmap = ffb_mmap, |
| 59 | .fb_ioctl = ffb_ioctl, | 59 | .fb_ioctl = ffb_ioctl, |
| 60 | #ifdef CONFIG_COMPAT | ||
| 61 | .fb_compat_ioctl = sbusfb_compat_ioctl, | ||
| 62 | #endif | ||
