summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 16:01:38 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 16:01:38 +0000
commitd983bb3d1e042a0c2b7e5a22231889f9c0d7da08 (patch)
tree365ec294f939bcfce31222c91ee3ea4d45c86f94 /sys/arch
parentd618b8a1cc45f47e9f2984d6d4a9183386334dc7 (diff)
convert arm apm lock to rwlock.
ok drahn@, todd@ tested.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c10
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.h4
2 files changed, 7 insertions, 7 deletions
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 <sys/systm.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
-#include <sys/lock.h>
+#include <sys/rwlock.h>
#include <sys/mount.h> /* for vfs_syncwait() */
#include <sys/proc.h>
#include <sys/device.h>
@@ -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 <uwe@bsdx.de>
@@ -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 */