···316typedef int drm_ioctl_t( struct inode *inode, struct file *filp,317 unsigned int cmd, unsigned long arg );318000319typedef struct drm_ioctl_desc {320 drm_ioctl_t *func;321 int auth_needed;···777extern int drm_version(struct inode *inode, struct file *filp,778 unsigned int cmd, unsigned long arg);779extern int drm_ioctl(struct inode *inode, struct file *filp,00780 unsigned int cmd, unsigned long arg);781extern int drm_takedown(drm_device_t * dev);782
···316typedef int drm_ioctl_t( struct inode *inode, struct file *filp,317 unsigned int cmd, unsigned long arg );318319+typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,320+ unsigned long arg);321+322typedef struct drm_ioctl_desc {323 drm_ioctl_t *func;324 int auth_needed;···774extern int drm_version(struct inode *inode, struct file *filp,775 unsigned int cmd, unsigned long arg);776extern int drm_ioctl(struct inode *inode, struct file *filp,777+ unsigned int cmd, unsigned long arg);778+extern long drm_compat_ioctl(struct file *filp,779 unsigned int cmd, unsigned long arg);780extern int drm_takedown(drm_device_t * dev);781
+18-7
drivers/char/drm/drm_bufs.c
···60}61EXPORT_SYMBOL(drm_order);6200000000063/**64 * Ioctl to specify a range of memory that is available for mapping by a non-root process.65 *···196197 down(&dev->struct_sem);198 list_add(&list->head, &dev->maplist->head);000000199 up(&dev->struct_sem);200201 if ( copy_to_user( argp, map, sizeof(*map) ) )202 return -EFAULT;203- if ( map->type != _DRM_SHM ) {204- if ( copy_to_user( &argp->handle,205- &map->offset,206- sizeof(map->offset) ) )207- return -EFAULT;208- }209 return 0;210}211···251 r_list = list_entry(list, drm_map_list_t, head);252253 if(r_list->map &&254- r_list->map->handle == request.handle &&255 r_list->map->flags & _DRM_REMOVABLE) break;256 }257
···60}61EXPORT_SYMBOL(drm_order);6263+#ifdef CONFIG_COMPAT64+/*65+ * Used to allocate 32-bit handles for _DRM_SHM regions66+ * The 0x10000000 value is chosen to be out of the way of67+ * FB/register and GART physical addresses.68+ */69+static unsigned int map32_handle = 0x10000000;70+#endif71+72/**73 * Ioctl to specify a range of memory that is available for mapping by a non-root process.74 *···187188 down(&dev->struct_sem);189 list_add(&list->head, &dev->maplist->head);190+#ifdef CONFIG_COMPAT191+ /* Assign a 32-bit handle for _DRM_SHM mappings */192+ /* We do it here so that dev->struct_sem protects the increment */193+ if (map->type == _DRM_SHM)194+ map->offset = map32_handle += PAGE_SIZE;195+#endif196 up(&dev->struct_sem);197198 if ( copy_to_user( argp, map, sizeof(*map) ) )199 return -EFAULT;200+ if (copy_to_user(&argp->handle, &map->offset, sizeof(map->offset)))201+ return -EFAULT;0000202 return 0;203}204···240 r_list = list_entry(list, drm_map_list_t, head);241242 if(r_list->map &&243+ r_list->map->offset == (unsigned long) request.handle &&244 r_list->map->flags & _DRM_REMOVABLE) break;245 }246
···317extern int radeon_postinit( struct drm_device *dev, unsigned long flags );318extern int radeon_postcleanup( struct drm_device *dev );319000320/* Flags for stats.boxes321 */322#define RADEON_BOX_DMA_IDLE 0x1
···317extern int radeon_postinit( struct drm_device *dev, unsigned long flags );318extern int radeon_postcleanup( struct drm_device *dev );319320+extern long radeon_compat_ioctl(struct file *filp, unsigned int cmd,321+ unsigned long arg);322+323/* Flags for stats.boxes324 */325#define RADEON_BOX_DMA_IDLE 0x1