diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-02-21 23:23:09 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-02-21 23:23:09 +0000 |
commit | cfa778af9c70faea8c13e5cb7f80029eee0d074e (patch) | |
tree | 15483e64b6c2b56d3bb0f247df9df2c2602e0404 /bsd/drm_lists.h | |
parent | a64472d18493de575a7636704b45babe7b4b4572 (diff) |
Merge from bsd-4-0-0-branch.bsd-4-0-0-20030221-merge
Diffstat (limited to 'bsd/drm_lists.h')
-rw-r--r-- | bsd/drm_lists.h | 9 |
1 files changed, 6 insertions, 3 deletions
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; |