diff options
Diffstat (limited to 'bsd/drm_lists.h')
-rw-r--r-- | bsd/drm_lists.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bsd/drm_lists.h b/bsd/drm_lists.h index 1ab55f90..8c34e117 100644 --- a/bsd/drm_lists.h +++ b/bsd/drm_lists.h @@ -27,6 +27,8 @@ * Authors: * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> + * + * $FreeBSD: src/sys/dev/drm/drm_lists.h,v 1.3 2003/03/09 02:08:28 anholt Exp $ */ #include "drmP.h" @@ -43,7 +45,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 +68,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 +141,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 +180,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 +227,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; |