Merge branch 'linus' into core/rodata
[linux-2.6-block.git] / drivers / char / drm / drm_os_linux.h
index 132c5580358bfa3b2a8577050dd6a28d60fa2453..8dbd2572b7c3bc558bee3f6f3b18b1989c69e5fb 100644 (file)
@@ -6,12 +6,8 @@
 #include <linux/interrupt.h>   /* For task queue support */
 #include <linux/delay.h>
 
-/** File pointer type */
-#define DRMFILE                         struct file *
-/** Ioctl arguments */
-#define DRM_IOCTL_ARGS                 struct inode *inode, struct file *filp, unsigned int cmd, unsigned long data
 /** Current process ID */
-#define DRM_CURRENTPID                 current->pid
+#define DRM_CURRENTPID                 task_pid_nr(current)
 #define DRM_SUSER(p)                   capable(CAP_SYS_ADMIN)
 #define DRM_UDELAY(d)                  udelay(d)
 /** Read a byte from a MMIO region */
@@ -32,9 +28,6 @@
 #define DRM_WRITEMEMORYBARRIER()       wmb()
 /** Read/write memory barrier */
 #define DRM_MEMORYBARRIER()            mb()
-/** DRM device local declaration */
-#define DRM_DEVICE     struct drm_file *priv   = filp->private_data; \
-                       struct drm_device *dev  = priv->head->dev
 
 /** IRQ handler arguments and return type and values */
 #define DRM_IRQ_ARGS           int irq, void *arg
@@ -69,14 +62,6 @@ static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
 
 #endif
 
-/** For data going into the kernel through the ioctl argument */
-#define DRM_COPY_FROM_USER_IOCTL(arg1, arg2, arg3)     \
-       if ( copy_from_user(&arg1, arg2, arg3) )        \
-               return -EFAULT
-/** For data going from the kernel through the ioctl argument */
-#define DRM_COPY_TO_USER_IOCTL(arg1, arg2, arg3)       \
-       if ( copy_to_user(arg1, &arg2, arg3) )          \
-               return -EFAULT
 /** Other copying of data to kernel space */
 #define DRM_COPY_FROM_USER(arg1, arg2, arg3)           \
        copy_from_user(arg1, arg2, arg3)
@@ -84,17 +69,15 @@ static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
 #define DRM_COPY_TO_USER(arg1, arg2, arg3)             \
        copy_to_user(arg1, arg2, arg3)
 /* Macros for copyfrom user, but checking readability only once */
-#define DRM_VERIFYAREA_READ( uaddr, size )             \
+#define DRM_VERIFYAREA_READ( uaddr, size )             \
        (access_ok( VERIFY_READ, uaddr, size ) ? 0 : -EFAULT)
-#define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3)         \
+#define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) \
        __copy_from_user(arg1, arg2, arg3)
 #define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3)   \
        __copy_to_user(arg1, arg2, arg3)
 #define DRM_GET_USER_UNCHECKED(val, uaddr)             \
        __get_user(val, uaddr)
 
-#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
-
 #define DRM_HZ HZ
 
 #define DRM_WAIT_ON( ret, queue, timeout, condition )          \