summaryrefslogtreecommitdiff
path: root/linux-core/drm_os_linux.h
diff options
context:
space:
mode:
authorLeif Delgass <ldelgass@users.sourceforge.net>2003-04-08 01:30:43 +0000
committerLeif Delgass <ldelgass@users.sourceforge.net>2003-04-08 01:30:43 +0000
commit10444e06d4f4edaf8e8cd9370f450ce7c047efac (patch)
tree294d347bd34529e341a363bc093287b5b236c601 /linux-core/drm_os_linux.h
parent3f7769921bd414f489d4487a5760a8d814efd51d (diff)
Use list_entry() to get container struct from struct list_head pointers.
Build fix for RedHat 9 kernel (5 args to remap_page_range()).
Diffstat (limited to 'linux-core/drm_os_linux.h')
-rw-r--r--linux-core/drm_os_linux.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h
index b57efd34..b760c169 100644
--- a/linux-core/drm_os_linux.h
+++ b/linux-core/drm_os_linux.h
@@ -47,9 +47,8 @@
#define DRM_GETSAREA() \
do { \
- struct list_head *list; \
- list_for_each( list, &dev->maplist->head ) { \
- drm_map_list_t *entry = (drm_map_list_t *)list; \
+ drm_map_list_t *entry; \
+ list_for_each_entry( entry, &dev->maplist->head, head ) { \
if ( entry->map && \
entry->map->type == _DRM_SHM && \
(entry->map->flags & _DRM_CONTAINS_LOCK) ) { \
@@ -61,28 +60,28 @@ do { \
#define DRM_HZ HZ
-#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
-do { \
- DECLARE_WAITQUEUE(entry, current); \
- unsigned long end = jiffies + (timeout); \
- add_wait_queue(&(queue), &entry); \
- \
- for (;;) { \
- current->state = TASK_INTERRUPTIBLE; \
- if (condition) \
- break; \
- if((signed)(end - jiffies) <= 0) { \
- ret = -EBUSY; \
- break; \
- } \
+#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
+do { \
+ DECLARE_WAITQUEUE(entry, current); \
+ unsigned long end = jiffies + (timeout); \
+ add_wait_queue(&(queue), &entry); \
+ \
+ for (;;) { \
+ current->state = TASK_INTERRUPTIBLE; \
+ if (condition) \
+ break; \
+ if((signed)(end - jiffies) <= 0) { \
+ ret = -EBUSY; \
+ break; \
+ } \
schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
- if (signal_pending(current)) { \
- ret = -EINTR; \
- break; \
- } \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&(queue), &entry); \
+ if (signal_pending(current)) { \
+ ret = -EINTR; \
+ break; \
+ } \
+ } \
+ current->state = TASK_RUNNING; \
+ remove_wait_queue(&(queue), &entry); \
} while (0)