Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
drm_os_linux.h File Reference
#include <linux/interrupt.h>
#include <linux/delay.h>

Go to the source code of this file.

Data Structures

struct  no_agp_kern
 

Macros

#define DRM_CURRENTPID   task_pid_nr(current)
 
#define DRM_SUSER(p)   capable(CAP_SYS_ADMIN)
 
#define DRM_UDELAY(d)   udelay(d)
 
#define DRM_READ8(map, offset)   readb(((void __iomem *)(map)->handle) + (offset))
 
#define DRM_READ16(map, offset)   readw(((void __iomem *)(map)->handle) + (offset))
 
#define DRM_READ32(map, offset)   readl(((void __iomem *)(map)->handle) + (offset))
 
#define DRM_WRITE8(map, offset, val)   writeb(val, ((void __iomem *)(map)->handle) + (offset))
 
#define DRM_WRITE16(map, offset, val)   writew(val, ((void __iomem *)(map)->handle) + (offset))
 
#define DRM_WRITE32(map, offset, val)   writel(val, ((void __iomem *)(map)->handle) + (offset))
 
#define DRM_READ64(map, offset)   readq(((void __iomem *)(map)->handle) + (offset))
 
#define DRM_WRITE64(map, offset, val)   writeq(val, ((void __iomem *)(map)->handle) + (offset))
 
#define DRM_READMEMORYBARRIER()   rmb()
 
#define DRM_WRITEMEMORYBARRIER()   wmb()
 
#define DRM_MEMORYBARRIER()   mb()
 
#define DRM_IRQ_ARGS   int irq, void *arg
 
#define DRM_AGP_MEM   int
 
#define DRM_AGP_KERN   struct no_agp_kern
 
#define MTRR_TYPE_WRCOMB   1
 
#define DRM_COPY_FROM_USER(arg1, arg2, arg3)   copy_from_user(arg1, arg2, arg3)
 
#define DRM_COPY_TO_USER(arg1, arg2, arg3)   copy_to_user(arg1, arg2, arg3)
 
#define DRM_VERIFYAREA_READ(uaddr, size)   (access_ok( VERIFY_READ, uaddr, size ) ? 0 : -EFAULT)
 
#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)
 
#define DRM_GET_USER_UNCHECKED(val, uaddr)   __get_user(val, uaddr)
 
#define DRM_HZ   HZ
 
#define DRM_WAIT_ON(ret, queue, timeout, condition)
 
#define DRM_WAKEUP(queue)   wake_up( queue )
 
#define DRM_INIT_WAITQUEUE(queue)   init_waitqueue_head( queue )
 

Detailed Description

OS abstraction macros.

Definition in file drm_os_linux.h.

Macro Definition Documentation

#define DRM_AGP_KERN   struct no_agp_kern

Definition at line 65 of file drm_os_linux.h.

#define DRM_AGP_MEM   int

Definition at line 64 of file drm_os_linux.h.

#define DRM_COPY_FROM_USER (   arg1,
  arg2,
  arg3 
)    copy_from_user(arg1, arg2, arg3)

Other copying of data to kernel space

Definition at line 85 of file drm_os_linux.h.

#define DRM_COPY_FROM_USER_UNCHECKED (   arg1,
  arg2,
  arg3 
)    __copy_from_user(arg1, arg2, arg3)

Definition at line 93 of file drm_os_linux.h.

#define DRM_COPY_TO_USER (   arg1,
  arg2,
  arg3 
)    copy_to_user(arg1, arg2, arg3)

Other copying of data from kernel space

Definition at line 88 of file drm_os_linux.h.

#define DRM_COPY_TO_USER_UNCHECKED (   arg1,
  arg2,
  arg3 
)    __copy_to_user(arg1, arg2, arg3)

Definition at line 95 of file drm_os_linux.h.

#define DRM_CURRENTPID   task_pid_nr(current)

Current process ID

Definition at line 23 of file drm_os_linux.h.

#define DRM_GET_USER_UNCHECKED (   val,
  uaddr 
)    __get_user(val, uaddr)

Definition at line 97 of file drm_os_linux.h.

#define DRM_HZ   HZ

Definition at line 100 of file drm_os_linux.h.

#define DRM_INIT_WAITQUEUE (   queue)    init_waitqueue_head( queue )

Definition at line 127 of file drm_os_linux.h.

#define DRM_IRQ_ARGS   int irq, void *arg

IRQ handler arguments and return type and values

Definition at line 52 of file drm_os_linux.h.

#define DRM_MEMORYBARRIER ( )    mb()

Read/write memory barrier

Definition at line 49 of file drm_os_linux.h.

#define DRM_READ16 (   map,
  offset 
)    readw(((void __iomem *)(map)->handle) + (offset))

Read a word from a MMIO region

Definition at line 29 of file drm_os_linux.h.

#define DRM_READ32 (   map,
  offset 
)    readl(((void __iomem *)(map)->handle) + (offset))

Read a dword from a MMIO region

Definition at line 31 of file drm_os_linux.h.

#define DRM_READ64 (   map,
  offset 
)    readq(((void __iomem *)(map)->handle) + (offset))

Read memory barrier Read a qword from a MMIO region - be careful using these unless you really understand them

Definition at line 41 of file drm_os_linux.h.

#define DRM_READ8 (   map,
  offset 
)    readb(((void __iomem *)(map)->handle) + (offset))

Read a byte from a MMIO region

Definition at line 27 of file drm_os_linux.h.

#define DRM_READMEMORYBARRIER ( )    rmb()

Definition at line 45 of file drm_os_linux.h.

#define DRM_SUSER (   p)    capable(CAP_SYS_ADMIN)

Definition at line 24 of file drm_os_linux.h.

#define DRM_UDELAY (   d)    udelay(d)

Definition at line 25 of file drm_os_linux.h.

#define DRM_VERIFYAREA_READ (   uaddr,
  size 
)    (access_ok( VERIFY_READ, uaddr, size ) ? 0 : -EFAULT)

Definition at line 91 of file drm_os_linux.h.

#define DRM_WAIT_ON (   ret,
  queue,
  timeout,
  condition 
)
Value:
do { \
DECLARE_WAITQUEUE(entry, current); \
unsigned long end = jiffies + (timeout); \
add_wait_queue(&(queue), &entry); \
for (;;) { \
__set_current_state(TASK_INTERRUPTIBLE); \
if (condition) \
break; \
if (time_after_eq(jiffies, end)) { \
ret = -EBUSY; \
break; \
} \
schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
if (signal_pending(current)) { \
ret = -EINTR; \
break; \
} \
} \
__set_current_state(TASK_RUNNING); \
remove_wait_queue(&(queue), &entry); \
} while (0)

Definition at line 102 of file drm_os_linux.h.

#define DRM_WAKEUP (   queue)    wake_up( queue )

Definition at line 126 of file drm_os_linux.h.

#define DRM_WRITE16 (   map,
  offset,
  val 
)    writew(val, ((void __iomem *)(map)->handle) + (offset))

Write a word into a MMIO region

Definition at line 35 of file drm_os_linux.h.

#define DRM_WRITE32 (   map,
  offset,
  val 
)    writel(val, ((void __iomem *)(map)->handle) + (offset))

Write a dword into a MMIO region

Definition at line 37 of file drm_os_linux.h.

#define DRM_WRITE64 (   map,
  offset,
  val 
)    writeq(val, ((void __iomem *)(map)->handle) + (offset))

Write a qword into a MMIO region

Definition at line 43 of file drm_os_linux.h.

#define DRM_WRITE8 (   map,
  offset,
  val 
)    writeb(val, ((void __iomem *)(map)->handle) + (offset))

Write a byte into a MMIO region

Definition at line 33 of file drm_os_linux.h.

#define DRM_WRITEMEMORYBARRIER ( )    wmb()

Write memory barrier

Definition at line 47 of file drm_os_linux.h.

#define MTRR_TYPE_WRCOMB   1

Definition at line 80 of file drm_os_linux.h.