summaryrefslogtreecommitdiff
path: root/linux-core/drm_compat.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-12-20 14:40:36 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-12-20 14:40:36 +0100
commit672593f611df484af89e425ff5f1ea0ea074f2bb (patch)
tree98f2c614c9107fdc891a9cff56811b48a7fbe8ee /linux-core/drm_compat.h
parent3b47b27558915a3a28591209e324b977e09d7c03 (diff)
Replace vmalloc_32.
The vmalloc_32 function together with the memset to clear the new pages are replaced with a vmalloc_user. A pre-2.6.18 compat vmalloc_user is added. Please replace any breakage on machines with > 1GB of memory.
Diffstat (limited to 'linux-core/drm_compat.h')
-rw-r--r--linux-core/drm_compat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index c7a4a7e3..dcda1936 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -148,6 +148,13 @@ static __inline__ void *kcalloc(size_t nmemb, size_t size, int flags)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#define vmalloc_user(_size) ({void * tmp = vmalloc(_size); \
+ if (tmp) memset(tmp, 0, size); \
+ (tmp);})
+#endif
+
+
#include <linux/mm.h>
#include <asm/page.h>