From 46ccea61c3ad6a4579fd2a92965c2cf31f63431c Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 29 Jul 2005 21:06:09 +0000 Subject: [PATCH] Catch up with the atomic_FOO_ptr() changes and silence a few warnings. --- lib/libkse/sys/lock.c | 21 ++++++++++++++------- lib/libpthread/sys/lock.c | 21 ++++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/lib/libkse/sys/lock.c b/lib/libkse/sys/lock.c index 0f0f5f9ce149..2ac8c0c09370 100644 --- a/lib/libkse/sys/lock.c +++ b/lib/libkse/sys/lock.c @@ -180,7 +180,9 @@ _lock_acquire(struct lock *lck, struct lockuser *lu, int prio) atomic_swap_ptr(&lck->l_head, lu->lu_myreq, &lu->lu_watchreq); if (lu->lu_watchreq->lr_locked != 0) { - atomic_store_rel_ptr(&lu->lu_watchreq->lr_watcher, lu); + atomic_store_rel_ptr + ((volatile uintptr_t *)&lu->lu_watchreq->lr_watcher, + (uintptr_t)lu); if ((lck->l_wait == NULL) || ((lck->l_type & LCK_ADAPTIVE) == 0)) { while (lu->lu_watchreq->lr_locked != 0) @@ -250,14 +252,19 @@ _lock_release(struct lock *lck, struct lockuser *lu) /* Update tail if our request is last. */ if (lu->lu_watchreq->lr_owner == NULL) { - atomic_store_rel_ptr(&lck->l_tail, lu->lu_myreq); - atomic_store_rel_ptr(&lu->lu_myreq->lr_owner, NULL); + atomic_store_rel_ptr((volatile uintptr_t *)&lck->l_tail, + (uintptr_t)lu->lu_myreq); + atomic_store_rel_ptr + ((volatile uintptr_t *)&lu->lu_myreq->lr_owner, + (uintptr_t)NULL); } else { /* Remove ourselves from the list. */ - atomic_store_rel_ptr(&lu->lu_myreq->lr_owner, - lu->lu_watchreq->lr_owner); - atomic_store_rel_ptr( - &lu->lu_watchreq->lr_owner->lu_myreq, lu->lu_myreq); + atomic_store_rel_ptr((volatile uintptr_t *) + &lu->lu_myreq->lr_owner, + (uintptr_t)lu->lu_watchreq->lr_owner); + atomic_store_rel_ptr((volatile uintptr_t *) + &lu->lu_watchreq->lr_owner->lu_myreq, + (uintptr_t)lu->lu_myreq); } /* * The watch request now becomes our own because we've diff --git a/lib/libpthread/sys/lock.c b/lib/libpthread/sys/lock.c index 0f0f5f9ce149..2ac8c0c09370 100644 --- a/lib/libpthread/sys/lock.c +++ b/lib/libpthread/sys/lock.c @@ -180,7 +180,9 @@ _lock_acquire(struct lock *lck, struct lockuser *lu, int prio) atomic_swap_ptr(&lck->l_head, lu->lu_myreq, &lu->lu_watchreq); if (lu->lu_watchreq->lr_locked != 0) { - atomic_store_rel_ptr(&lu->lu_watchreq->lr_watcher, lu); + atomic_store_rel_ptr + ((volatile uintptr_t *)&lu->lu_watchreq->lr_watcher, + (uintptr_t)lu); if ((lck->l_wait == NULL) || ((lck->l_type & LCK_ADAPTIVE) == 0)) { while (lu->lu_watchreq->lr_locked != 0) @@ -250,14 +252,19 @@ _lock_release(struct lock *lck, struct lockuser *lu) /* Update tail if our request is last. */ if (lu->lu_watchreq->lr_owner == NULL) { - atomic_store_rel_ptr(&lck->l_tail, lu->lu_myreq); - atomic_store_rel_ptr(&lu->lu_myreq->lr_owner, NULL); + atomic_store_rel_ptr((volatile uintptr_t *)&lck->l_tail, + (uintptr_t)lu->lu_myreq); + atomic_store_rel_ptr + ((volatile uintptr_t *)&lu->lu_myreq->lr_owner, + (uintptr_t)NULL); } else { /* Remove ourselves from the list. */ - atomic_store_rel_ptr(&lu->lu_myreq->lr_owner, - lu->lu_watchreq->lr_owner); - atomic_store_rel_ptr( - &lu->lu_watchreq->lr_owner->lu_myreq, lu->lu_myreq); + atomic_store_rel_ptr((volatile uintptr_t *) + &lu->lu_myreq->lr_owner, + (uintptr_t)lu->lu_watchreq->lr_owner); + atomic_store_rel_ptr((volatile uintptr_t *) + &lu->lu_watchreq->lr_owner->lu_myreq, + (uintptr_t)lu->lu_myreq); } /* * The watch request now becomes our own because we've