1 /* $Id: ia32_ioctl.c,v 1.25 2002/10/11 07:17:06 ak Exp $
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
8 * These routines maintain argument size conversion between 32bit and 64bit
13 #include <linux/syscalls.h>
14 #include "compat_ioctl.c"
18 #include "compat_ioctl.c"
20 #define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */
21 #define RTC_IRQP_SET32 _IOW('p', 0x0c, unsigned int) /* Set IRQ rate */
22 #define RTC_EPOCH_READ32 _IOR('p', 0x0d, unsigned) /* Read epoch */
23 #define RTC_EPOCH_SET32 _IOW('p', 0x0e, unsigned) /* Set epoch */
25 static int rtc32_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
28 mm_segment_t oldfs = get_fs();
34 ret = sys_ioctl(fd, RTC_IRQP_READ, (unsigned long)&val);
37 ret = put_user(val, (unsigned int __user *) arg);
44 case RTC_EPOCH_READ32:
46 ret = sys_ioctl(fd, RTC_EPOCH_READ, (unsigned long) &val);
49 ret = put_user(val, (unsigned int __user *) arg);
56 return sys_ioctl(fd,cmd,arg);
60 #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler) },
61 #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
63 struct ioctl_trans ioctl_start[] = {
64 #include <linux/compat_ioctl.h>
66 #include "compat_ioctl.c"
67 COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
68 COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
69 COMPATIBLE_IOCTL(BLKRASET)
70 COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
71 COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
72 COMPATIBLE_IOCTL(FIOQSIZE)
74 /* And these ioctls need translation */
76 HANDLE_IOCTL(RTC_IRQP_READ, rtc32_ioctl)
77 HANDLE_IOCTL(RTC_IRQP_READ32,rtc32_ioctl)
78 HANDLE_IOCTL(RTC_IRQP_SET32, rtc32_ioctl)
79 HANDLE_IOCTL(RTC_EPOCH_READ32, rtc32_ioctl)
80 HANDLE_IOCTL(RTC_EPOCH_SET32, rtc32_ioctl)
81 /* take care of sizeof(sizeof()) breakage */
84 int ioctl_table_size = ARRAY_SIZE(ioctl_start);