From fa3fdbd99c6b6e5cec59f1044ce6ce1105b5e8dd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 7 Nov 2004 00:25:49 +0000 Subject: Now that the memory debug code is gone, and all 3 BSDs have M_ZERO, stop using drm_alloc/drm_free in the core and instead use plain malloc/free. --- bsd-core/drm_context.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bsd-core/drm_context.c') diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 87185f4e..d785d361 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -73,12 +73,9 @@ int drm_ctxbitmap_next(drm_device_t *dev) if (dev->context_sareas != NULL) { drm_local_map_t **ctx_sareas; - ctx_sareas = drm_realloc(dev->context_sareas, - (dev->max_context - 1) * - sizeof(*dev->context_sareas), - dev->max_context * - sizeof(*dev->context_sareas), - DRM_MEM_MAPS); + ctx_sareas = realloc(dev->context_sareas, + dev->max_context * sizeof(*dev->context_sareas), + M_DRM, M_NOWAIT); if (ctx_sareas == NULL) { clear_bit(bit, dev->ctx_bitmap); DRM_UNLOCK(); @@ -88,8 +85,8 @@ int drm_ctxbitmap_next(drm_device_t *dev) dev->context_sareas[bit] = NULL; } else { /* max_context == 1 at this point */ - dev->context_sareas = drm_alloc(dev->max_context * - sizeof(*dev->context_sareas), DRM_MEM_MAPS); + dev->context_sareas = malloc(dev->max_context * + sizeof(*dev->context_sareas), M_DRM, M_NOWAIT); if (dev->context_sareas == NULL) { clear_bit(bit, dev->ctx_bitmap); DRM_UNLOCK(); @@ -108,8 +105,7 @@ int drm_ctxbitmap_init(drm_device_t *dev) int temp; DRM_LOCK(); - dev->ctx_bitmap = (atomic_t *)drm_calloc(1, PAGE_SIZE, - DRM_MEM_CTXBITMAP); + dev->ctx_bitmap = malloc(PAGE_SIZE, M_DRM, M_NOWAIT | M_ZERO); if ( dev->ctx_bitmap == NULL ) { DRM_UNLOCK(); return DRM_ERR(ENOMEM); @@ -130,9 +126,8 @@ void drm_ctxbitmap_cleanup(drm_device_t *dev) { DRM_LOCK(); if (dev->context_sareas != NULL) - drm_free(dev->context_sareas, sizeof(*dev->context_sareas) * - dev->max_context, DRM_MEM_MAPS); - drm_free((void *)dev->ctx_bitmap, PAGE_SIZE, DRM_MEM_CTXBITMAP); + free(dev->context_sareas, M_DRM); + free(dev->ctx_bitmap, M_DRM); DRM_UNLOCK(); } -- cgit v1.2.3