From f109feca4480e12c79a114a32309e906f30ecbfd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 26 Feb 2009 10:12:10 +1000 Subject: [PATCH] --- yaml --- r: 138971 b: refs/heads/master c: 87f0da55353e23826a54bff57c457a13b97d18f1 h: refs/heads/master i: 138969: 715c07cfa6b9e0736f3703083fe1c069197c80a6 138967: 5567d41799bcd136fc3f47afcb0db3a4f5eec95e v: v3 --- [refs] | 2 +- trunk/include/drm/drm_os_linux.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 103c7bddd9a1..5d87844a2ad1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8ced9c75160947d2235fba75de9413e087e1171a +refs/heads/master: 87f0da55353e23826a54bff57c457a13b97d18f1 diff --git a/trunk/include/drm/drm_os_linux.h b/trunk/include/drm/drm_os_linux.h index 8dbd2572b7c3..013551d03c03 100644 --- a/trunk/include/drm/drm_os_linux.h +++ b/trunk/include/drm/drm_os_linux.h @@ -6,6 +6,19 @@ #include /* For task queue support */ #include +#ifndef readq +static u64 readq(void __iomem *reg) +{ + return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32); +} + +static 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) @@ -23,6 +36,12 @@ /** 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()