Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138971
b: refs/heads/master
c: 87f0da5
h: refs/heads/master
i:
  138969: 715c07c
  138967: 5567d41
v: v3
  • Loading branch information
Dave Airlie committed Mar 13, 2009
1 parent 409d423 commit f109fec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ced9c75160947d2235fba75de9413e087e1171a
refs/heads/master: 87f0da55353e23826a54bff57c457a13b97d18f1
19 changes: 19 additions & 0 deletions trunk/include/drm/drm_os_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
#include <linux/interrupt.h> /* For task queue support */
#include <linux/delay.h>

#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)
Expand All @@ -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()
Expand Down

0 comments on commit f109fec

Please sign in to comment.