2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
5 * Copyright (C) 2000-2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Gerhard Tonn (ton@de.ibm.com)
7 * Arnd Bergmann (arndb@de.ibm.com)
9 * Original implementation from 32-bit Sparc compat code which is
10 * Copyright (C) 2000 Silicon Graphics, Inc.
11 * Written by Ulf Carlsson (ulfc@engr.sgi.com)
14 #include "compat_linux.h"
17 #include "../../../fs/compat_ioctl.c"
20 #include <asm/tape390.h>
22 static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
23 unsigned long arg, struct file *f)
25 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
28 static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
29 unsigned long arg, struct file *f)
31 return sys_ioctl(fd, cmd, arg);
34 #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
35 #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
36 #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
38 struct ioctl_trans ioctl_start[] = {
39 /* architecture independent ioctls */
40 #include <linux/compat_ioctl.h>
42 #include "../../../fs/compat_ioctl.c"
44 /* s390 only ioctls */
45 COMPATIBLE_IOCTL(DASDAPIVER)
46 COMPATIBLE_IOCTL(BIODASDDISABLE)
47 COMPATIBLE_IOCTL(BIODASDENABLE)
48 COMPATIBLE_IOCTL(BIODASDRSRV)
49 COMPATIBLE_IOCTL(BIODASDRLSE)
50 COMPATIBLE_IOCTL(BIODASDSLCK)
51 COMPATIBLE_IOCTL(BIODASDINFO)
52 COMPATIBLE_IOCTL(BIODASDINFO2)
53 COMPATIBLE_IOCTL(BIODASDFMT)
54 COMPATIBLE_IOCTL(BIODASDPRRST)
55 COMPATIBLE_IOCTL(BIODASDQUIESCE)
56 COMPATIBLE_IOCTL(BIODASDRESUME)
57 COMPATIBLE_IOCTL(BIODASDPRRD)
58 COMPATIBLE_IOCTL(BIODASDPSRD)
59 COMPATIBLE_IOCTL(BIODASDGATTR)
60 COMPATIBLE_IOCTL(BIODASDSATTR)
61 COMPATIBLE_IOCTL(BIODASDCMFENABLE)
62 COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
63 COMPATIBLE_IOCTL(BIODASDREADALLCMB)
65 COMPATIBLE_IOCTL(TAPE390_DISPLAY)
67 /* s390 doesn't need handlers here */
68 COMPATIBLE_IOCTL(TIOCGSERIAL)
69 COMPATIBLE_IOCTL(TIOCSSERIAL)
72 int ioctl_table_size = ARRAY_SIZE(ioctl_start);