~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to include/drm/drm_os_linux.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include <linux/interrupt.h>    /* For task queue support */
7
7
#include <linux/delay.h>
8
8
 
 
9
#ifndef readq
 
10
static inline u64 readq(void __iomem *reg)
 
11
{
 
12
        return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32);
 
13
}
 
14
 
 
15
static inline void writeq(u64 val, void __iomem *reg)
 
16
{
 
17
        writel(val & 0xffffffff, reg);
 
18
        writel(val >> 32, reg + 0x4UL);
 
19
}
 
20
#endif
 
21
 
9
22
/** Current process ID */
10
23
#define DRM_CURRENTPID                  task_pid_nr(current)
11
24
#define DRM_SUSER(p)                    capable(CAP_SYS_ADMIN)
23
36
/** Write a dword into a MMIO region */
24
37
#define DRM_WRITE32(map, offset, val)   writel(val, ((void __iomem *)(map)->handle) + (offset))
25
38
/** Read memory barrier */
 
39
 
 
40
/** Read a qword from a MMIO region - be careful using these unless you really understand them */
 
41
#define DRM_READ64(map, offset)         readq(((void __iomem *)(map)->handle) + (offset))
 
42
/** Write a qword into a MMIO region */
 
43
#define DRM_WRITE64(map, offset, val)   writeq(val, ((void __iomem *)(map)->handle) + (offset))
 
44
 
26
45
#define DRM_READMEMORYBARRIER()         rmb()
27
46
/** Write memory barrier */
28
47
#define DRM_WRITEMEMORYBARRIER()        wmb()