From cfa778af9c70faea8c13e5cb7f80029eee0d074e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 21 Feb 2003 23:23:09 +0000 Subject: Merge from bsd-4-0-0-branch. --- bsd/drm_lists.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bsd/drm_lists.h') diff --git a/bsd/drm_lists.h b/bsd/drm_lists.h index 1ab55f90..578a99a3 100644 --- a/bsd/drm_lists.h +++ b/bsd/drm_lists.h @@ -43,7 +43,7 @@ int DRM(waitlist_create)(drm_waitlist_t *bl, int count) if(!bl->bufs) return DRM_ERR(ENOMEM); - memset(bl->bufs, 0, sizeof(*bl->bufs)); + bzero(bl->bufs, sizeof(*bl->bufs)); bl->count = count; bl->rp = bl->bufs; @@ -66,6 +66,8 @@ int DRM(waitlist_destroy)(drm_waitlist_t *bl) bl->rp = NULL; bl->wp = NULL; bl->end = NULL; + DRM_SPINUNINIT( bl->write_lock ); + DRM_SPINUNINIT( bl->read_lock ); return 0; } @@ -137,6 +139,7 @@ int DRM(freelist_destroy)(drm_freelist_t *bl) { atomic_set(&bl->count, 0); bl->next = NULL; + DRM_SPINUNINIT( bl->lock ); return 0; } @@ -175,7 +178,7 @@ int DRM(freelist_put)(drm_device_t *dev, drm_freelist_t *bl, drm_buf_t *buf) /* Check for high water mark */ if (atomic_read(&bl->wfh) && atomic_read(&bl->count)>=bl->high_mark) { atomic_set(&bl->wfh, 0); - DRM_WAKEUP_INT(&bl->waiting); + DRM_WAKEUP_INT((void *)&bl->waiting); } return 0; } @@ -222,7 +225,7 @@ drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block) for (;;) { if (!atomic_read(&bl->wfh) && (buf = DRM(freelist_try(bl)))) break; - error = tsleep(&bl->waiting, PZERO|PCATCH, + error = tsleep((void *)&bl->waiting, PZERO|PCATCH, "drmfg", 0); if (error) break; -- cgit v1.2.3