summaryrefslogtreecommitdiff
path: root/linux-core/drm_os_linux.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-11-05 13:46:06 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-11-05 13:46:06 +0100
commit5ce43a346cb9b2a6f6f31f1f750db75d5628c15b (patch)
tree51a60696567d1c93b682435aecbbf5ae24a376b8 /linux-core/drm_os_linux.h
parent1b91113957e731d264d1e5d49326597f3b78e96f (diff)
parent427cc561b3dfbd504472e284e5fc16b63acd1816 (diff)
Merge branch 'master' into modesetting-101
Conflicts: linux-core/drm_bufs.c shared-core/i915_dma.c shared-core/i915_drv.h shared-core/i915_irq.c
Diffstat (limited to 'linux-core/drm_os_linux.h')
-rw-r--r--linux-core/drm_os_linux.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h
index 2688479a..8921944e 100644
--- a/linux-core/drm_os_linux.h
+++ b/linux-core/drm_os_linux.h
@@ -92,9 +92,9 @@ 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)
@@ -129,3 +129,17 @@ do { \
#define DRM_WAKEUP( queue ) wake_up_interruptible( queue )
#define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue )
+
+/** Type for the OS's non-sleepable mutex lock */
+#define DRM_SPINTYPE spinlock_t
+/**
+ * Initialize the lock for use. name is an optional string describing the
+ * lock
+ */
+#define DRM_SPININIT(l,name) spin_lock_init(l)
+#define DRM_SPINUNINIT(l)
+#define DRM_SPINLOCK(l) spin_lock(l)
+#define DRM_SPINUNLOCK(l) spin_unlock(l)
+#define DRM_SPINLOCK_IRQSAVE(l, _flags) spin_lock_irqsave(l, _flags);
+#define DRM_SPINUNLOCK_IRQRESTORE(l, _flags) spin_unlock_irqrestore(l, _flags);
+#define DRM_SPINLOCK_ASSERT(l) do {} while (0)