/* * \file drm_ioc32.c * * 32-bit ioctl compatibility routines for the DRM. * * \author Paul Mackerras <paulus@samba.org> * * Copyright (C) Paul Mackerras 2005. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE.
*/ #include <linux/compat.h> #include <linux/ratelimit.h> #include <linux/export.h>
typedefstruct drm_version_32 { int version_major; /* Major version */ int version_minor; /* Minor version */ int version_patchlevel; /* Patch level */
u32 name_len; /* Length of name buffer */
u32 name; /* Name of driver */
u32 date_len; /* Length of date buffer */
u32 date; /* User-space buffer to hold date */
u32 desc_len; /* Length of desc buffer */
u32 desc; /* User-space buffer to hold desc */
} drm_version32_t;
/** * drm_compat_ioctl - 32bit IOCTL compatibility handler for DRM drivers * @filp: file this ioctl is called on * @cmd: ioctl cmd number * @arg: user argument * * Compatibility handler for 32 bit userspace running on 64 kernels. All actual * IOCTL handling is forwarded to drm_ioctl(), while marshalling structures as * appropriate. Note that this only handles DRM core IOCTLs, if the driver has * botched IOCTL itself, it must handle those by wrapping this function. * * Returns: * Zero on success, negative error code on failure.
*/ long drm_compat_ioctl(struct file *filp, unsignedint cmd, unsignedlong arg)
{ unsignedint nr = DRM_IOCTL_NR(cmd); struct drm_file *file_priv = filp->private_data; struct drm_device *dev = file_priv->minor->dev;
drm_ioctl_compat_t *fn; int ret;
/* Assume that ioctls without an explicit compat routine will just * work. This may not always be a good assumption, but it's better * than always failing.
*/ if (nr >= ARRAY_SIZE(drm_compat_ioctls)) return drm_ioctl(filp, cmd, arg);
fn = drm_compat_ioctls[nr].fn; if (!fn) return drm_ioctl(filp, cmd, arg);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.