2 * Copyright 2007 Dave Airlie
3 * Copyright 2007 Alex Deucher
4 * Copyright 2007 Michel Dänzer
5 * Copyright 2007 Roland Scheidegger
6 * Copyright 2007 Vladimir Dergachev
7 * Copyright 2007 Nicolai Haehnle
8 * Copyright 2007 Aapo Tahkola
9 * Copyright 2007 Ben Skeggs
10 * Copyright 2007 Jérôme Glisse
11 * All Rights Reserved.
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
20 * The above copyright notice and this permission notice (including the next
21 * paragraph) shall be included in all copies or substantial portions of the
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
28 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
29 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 * DEALINGS IN THE SOFTWARE.
34 * Jerome Glisse <glisse@freedesktop.org>
38 #include "radeon_ms.h"
41 * Called whenever a 32-bit process running under a 64-bit kernel
42 * performs an ioctl on /dev/dri/card<n>.
44 * \param filp file pointer.
46 * \param arg user argument.
47 * \return zero on success or negative number on failure.
49 long radeon_ms_compat_ioctl(struct file *filp, unsigned int cmd,
52 unsigned int nr = DRM_IOCTL_NR(cmd);
53 drm_ioctl_compat_t *fn = NULL;
56 if (nr < DRM_COMMAND_BASE)
57 return drm_compat_ioctl(filp, cmd, arg);
61 ret = (*fn)(filp, cmd, arg);
63 ret = drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg);