linux/drivers/gpu/drm/drm_ioc32.c

/*
 * \file drm_ioc32.c
 *
 * 32-bit ioctl compatibility routines for the DRM.
 *
 * \author Paul Mackerras <[email protected]>
 *
 * 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>

#include <drm/drm_device.h>
#include <drm/drm_file.h>
#include <drm/drm_print.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"

#define DRM_IOCTL_VERSION32
#define DRM_IOCTL_GET_UNIQUE32
#define DRM_IOCTL_GET_MAP32
#define DRM_IOCTL_GET_CLIENT32
#define DRM_IOCTL_GET_STATS32

#define DRM_IOCTL_SET_UNIQUE32
#define DRM_IOCTL_ADD_MAP32
#define DRM_IOCTL_ADD_BUFS32
#define DRM_IOCTL_MARK_BUFS32
#define DRM_IOCTL_INFO_BUFS32
#define DRM_IOCTL_MAP_BUFS32
#define DRM_IOCTL_FREE_BUFS32

#define DRM_IOCTL_RM_MAP32

#define DRM_IOCTL_SET_SAREA_CTX32
#define DRM_IOCTL_GET_SAREA_CTX32

#define DRM_IOCTL_RES_CTX32
#define DRM_IOCTL_DMA32

#define DRM_IOCTL_AGP_ENABLE32
#define DRM_IOCTL_AGP_INFO32
#define DRM_IOCTL_AGP_ALLOC32
#define DRM_IOCTL_AGP_FREE32
#define DRM_IOCTL_AGP_BIND32
#define DRM_IOCTL_AGP_UNBIND32

#define DRM_IOCTL_SG_ALLOC32
#define DRM_IOCTL_SG_FREE32

#define DRM_IOCTL_UPDATE_DRAW32

#define DRM_IOCTL_WAIT_VBLANK32

#define DRM_IOCTL_MODE_ADDFB232

drm_version32_t;

static int compat_drm_version(struct file *file, unsigned int cmd,
			      unsigned long arg)
{}

drm_unique32_t;

static int compat_drm_getunique(struct file *file, unsigned int cmd,
				unsigned long arg)
{}

static int compat_drm_setunique(struct file *file, unsigned int cmd,
				unsigned long arg)
{}

drm_client32_t;

static int compat_drm_getclient(struct file *file, unsigned int cmd,
				unsigned long arg)
{}

drm_stats32_t;

static int compat_drm_getstats(struct file *file, unsigned int cmd,
			       unsigned long arg)
{}

#if defined(CONFIG_X86)
drm_update_draw32_t;

static int compat_drm_update_draw(struct file *file, unsigned int cmd,
				  unsigned long arg)
{}
#endif

struct drm_wait_vblank_request32 {};

struct drm_wait_vblank_reply32 {};

drm_wait_vblank32_t;

static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
				  unsigned long arg)
{}

#if defined(CONFIG_X86)
drm_mode_fb_cmd232_t;

static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd,
				  unsigned long arg)
{}
#endif

static struct {} drm_compat_ioctls[] =;

/**
 * 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, unsigned int cmd, unsigned long arg)
{}
EXPORT_SYMBOL();