From d983bb3d1e042a0c2b7e5a22231889f9c0d7da08 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Fri, 27 Mar 2009 16:01:38 +0000 Subject: convert arm apm lock to rwlock. ok drahn@, todd@ tested. --- sys/arch/arm/xscale/pxa2x0_apm.c | 10 +++++----- sys/arch/arm/xscale/pxa2x0_apm.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sys') diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c index ac439de0a70..9d2e5bc2343 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ b/sys/arch/arm/xscale/pxa2x0_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.30 2009/02/26 19:57:10 todd Exp $ */ +/* $OpenBSD: pxa2x0_apm.c,v 1.31 2009/03/27 16:01:37 oga Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include /* for vfs_syncwait() */ #include #include @@ -62,8 +62,8 @@ #define DPRINTF(x) /**/ #endif -#define APM_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL) -#define APM_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL) +#define APM_LOCK(sc) rw_enter_write(&(sc)->sc_lock); +#define APM_UNLOCK(sc) rw_exit_write(&(sc)->sc_lock); struct cfdriver apm_cd = { NULL, "apm", DV_DULL @@ -650,7 +650,7 @@ pxa2x0_apm_attach_sub(struct pxa2x0_apm_softc *sc) return; } - lockinit(&sc->sc_lock, PWAIT, "apmlk", 0, 0); + rw_init(&sc->sc_lock, "apmlk"); kthread_create_deferred(apm_thread_create, sc); diff --git a/sys/arch/arm/xscale/pxa2x0_apm.h b/sys/arch/arm/xscale/pxa2x0_apm.h index 7770c94e189..6d5fe3935f6 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.h +++ b/sys/arch/arm/xscale/pxa2x0_apm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.h,v 1.7 2005/04/13 05:40:07 uwe Exp $ */ +/* $OpenBSD: pxa2x0_apm.h,v 1.8 2009/03/27 16:01:37 oga Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler @@ -27,7 +27,7 @@ struct pxa2x0_apm_softc { struct device sc_dev; struct proc *sc_thread; - struct lock sc_lock; + struct rwlock sc_lock; struct klist sc_note; int sc_flags; int sc_wakeon; /* enabled wakeup sources */ -- cgit v1.2.3