]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/drm/drm_os_linux.h
ARM: Do early I/O mapping if spinlock debugging is enabled
[linux-2.6-omap-h63xx.git] / include / drm / drm_os_linux.h
index 8dbd2572b7c3bc558bee3f6f3b18b1989c69e5fb..26641e95e0a4be8cb0ce273c88eb65196bfe02af 100644 (file)
@@ -6,6 +6,19 @@
 #include <linux/interrupt.h>   /* For task queue support */
 #include <linux/delay.h>
 
+#ifndef readq
+static inline u64 readq(void __iomem *reg)
+{
+       return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32);
+}
+
+static inline void writeq(u64 val, void __iomem *reg)
+{
+       writel(val & 0xffffffff, reg);
+       writel(val >> 32, reg + 0x4UL);
+}
+#endif
+
 /** Current process ID */
 #define DRM_CURRENTPID                 task_pid_nr(current)
 #define DRM_SUSER(p)                   capable(CAP_SYS_ADMIN)
 /** Write a dword into a MMIO region */
 #define DRM_WRITE32(map, offset, val)  writel(val, ((void __iomem *)(map)->handle) + (offset))
 /** Read memory barrier */
+
+/** Read a qword from a MMIO region - be careful using these unless you really understand them */
+#define DRM_READ64(map, offset)                readq(((void __iomem *)(map)->handle) + (offset))
+/** Write a qword into a MMIO region */
+#define DRM_WRITE64(map, offset, val)  writeq(val, ((void __iomem *)(map)->handle) + (offset))
+
 #define DRM_READMEMORYBARRIER()                rmb()
 /** Write memory barrier */
 #define DRM_WRITEMEMORYBARRIER()       wmb()