IPL_VM -> IPL_SCHED, and callout_stop -> callout_halt

This commit is contained in:
jmcneill 2014-09-02 09:55:48 +00:00
parent fdfb248720
commit 95c59df5a7
3 changed files with 10 additions and 10 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: vchi_bsd.c,v 1.8 2014/04/25 15:49:17 skrll Exp $
* $Id: vchi_bsd.c,v 1.9 2014/09/02 09:55:48 jmcneill Exp $
*/
#include <sys/types.h>
@ -106,7 +106,7 @@ int
del_timer_sync(struct timer_list *t)
{
spin_lock(&t->mtx);
callout_stop(&t->callout);
callout_halt(&t->callout, &t->mtx);
spin_unlock(&t->mtx);
spin_lock_destroy(&t->mtx);
@ -136,7 +136,7 @@ void
_sema_init(struct semaphore *s, int value)
{
memset(s, 0, sizeof(*s));
mutex_init(&s->mtx, MUTEX_DEFAULT, IPL_VM);
mutex_init(&s->mtx, MUTEX_DEFAULT, IPL_SCHED);
cv_init(&s->cv, "semacv");
s->value = value;
}
@ -314,8 +314,8 @@ vchiq_thread_create(int (*threadfn)(void *data),
va_end(ap);
newt = NULL;
if (kthread_create(PRI_NONE, 0, NULL, kthread_wrapper, slot, &newt,
"%s", name) != 0) {
if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL, kthread_wrapper,
slot, &newt, "%s", name) != 0) {
/* Just to be sure */
newt = NULL;
} else {

View File

@ -123,7 +123,7 @@ typedef kmutex_t spinlock_t;
*/
#define DEFINE_SPINLOCK(name) kmutex_t name
#define spin_lock_init(lock) mutex_init(lock, MUTEX_DEFAULT, IPL_VM)
#define spin_lock_init(lock) mutex_init(lock, MUTEX_DEFAULT, IPL_SCHED)
#define spin_lock_destroy(lock) mutex_destroy(lock)
#define spin_lock(lock) mutex_spin_enter(lock)
#define spin_unlock(lock) mutex_spin_exit(lock)
@ -148,7 +148,7 @@ typedef kmutex_t rwlock_t;
#define DEFINE_RWLOCK(name) kmutex_t name
#define rwlock_init(rwlock) mutex_init(rwlock, MUTEX_DEFAULT, IPL_VM)
#define rwlock_init(rwlock) mutex_init(rwlock, MUTEX_DEFAULT, IPL_SCHED)
#define read_lock(rwlock) mutex_spin_enter(rwlock)
#define read_unlock(rwlock) mutex_spin_exit(rwlock)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vchiq_kmod_netbsd.c,v 1.2 2013/03/25 22:59:25 jmcneill Exp $ */
/* $NetBSD: vchiq_kmod_netbsd.c,v 1.3 2014/09/02 09:55:48 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.2 2013/03/25 22:59:25 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.3 2014/09/02 09:55:48 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -117,7 +117,7 @@ vchiq_defer(device_t self)
vchiq_core_initialize();
sc->sc_ih = bcm2835_intr_establish(sc->sc_intr, IPL_VM,
sc->sc_ih = bcm2835_intr_establish(sc->sc_intr, IPL_SCHED,
vchiq_intr, sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "failed to establish interrupt %d\n",