diff options
-rw-r--r-- | linux-core/drm_bufs.c | 3 | ||||
-rw-r--r-- | linux-core/drm_compat.h | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index ef110c28..1ff191ad 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -195,14 +195,13 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset, *maplist = list; return 0; } - map->handle = vmalloc_32(map->size); + map->handle = vmalloc_user(map->size); DRM_DEBUG("%lu %d %p\n", map->size, drm_order(map->size), map->handle); if (!map->handle) { drm_free(map, sizeof(*map), DRM_MEM_MAPS); return -ENOMEM; } - memset(map->handle, 0, map->size); map->offset = (unsigned long)map->handle; if (map->flags & _DRM_CONTAINS_LOCK) { /* Prevent a 2nd X Server from creating a 2nd lock */ 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> |