summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 16:02:42 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-03-27 16:02:42 +0000
commit5d0cbf63df54f4d9e00ee623c47f598d54ed279a (patch)
treedae1175e325b3fb458e4ad3351b6bcabb9538d3d /sys/arch/arm
parentd983bb3d1e042a0c2b7e5a22231889f9c0d7da08 (diff)
convert iopiic lockmgr to rwlock.
ok drahn@, sthen@ tested.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/xscale/i80321_i2c.c6
-rw-r--r--sys/arch/arm/xscale/iopi2c.c8
-rw-r--r--sys/arch/arm/xscale/iopi2cvar.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/sys/arch/arm/xscale/i80321_i2c.c b/sys/arch/arm/xscale/i80321_i2c.c
index ffa3eff6a18..4b3121dcfd0 100644
--- a/sys/arch/arm/xscale/i80321_i2c.c
+++ b/sys/arch/arm/xscale/i80321_i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i80321_i2c.c,v 1.2 2006/07/10 15:39:56 drahn Exp $ */
+/* $OpenBSD: i80321_i2c.c,v 1.3 2009/03/27 16:02:41 oga Exp $ */
/* $NetBSD: i80321_i2c.c,v 1.2 2005/12/11 12:16:51 christos Exp $ */
/*
@@ -41,7 +41,7 @@
*/
#include <sys/param.h>
-#include <sys/lock.h>
+#include <sys/rwlock.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
@@ -110,7 +110,7 @@ i80321_i2c_attach(struct device *parent, struct device *self, void *aux)
/* XXX Reset the I2C unit? */
- lockinit(&sc->sc_buslock, PRIBIO|PCATCH, "iopiiclk", 0, 0);
+ rw_init(&sc->sc_buslock, "iopiiclk");
/* XXX We don't currently use interrupts. Fix this some day. */
#if 0
diff --git a/sys/arch/arm/xscale/iopi2c.c b/sys/arch/arm/xscale/iopi2c.c
index 58cc3094aa3..7d5c01aabf6 100644
--- a/sys/arch/arm/xscale/iopi2c.c
+++ b/sys/arch/arm/xscale/iopi2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iopi2c.c,v 1.2 2006/07/10 15:39:56 drahn Exp $ */
+/* $OpenBSD: iopi2c.c,v 1.3 2009/03/27 16:02:41 oga Exp $ */
/* $NetBSD: iopi2c.c,v 1.3 2005/12/11 12:16:51 christos Exp $ */
/*
@@ -40,7 +40,7 @@
* Intel i80321 I/O Processor I2C Controller Unit support.
*/
#include <sys/param.h>
-#include <sys/lock.h>
+#include <sys/rwlock.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
@@ -96,7 +96,7 @@ iopiic_acquire_bus(void *cookie, int flags)
if (flags & I2C_F_POLL)
return (0);
- return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL));
+ return (rw_enter(&sc->sc_buslock, RW_WRITE | RW_INTR));
}
static void
@@ -108,7 +108,7 @@ iopiic_release_bus(void *cookie, int flags)
if (flags & I2C_F_POLL)
return;
- (void) lockmgr(&sc->sc_buslock, LK_RELEASE, NULL);
+ rw_exit(&sc->sc_buslock);
}
#define IOPIIC_TIMEOUT 100 /* protocol timeout, in uSecs */
diff --git a/sys/arch/arm/xscale/iopi2cvar.h b/sys/arch/arm/xscale/iopi2cvar.h
index 9d38bab837b..e8a3e3965ef 100644
--- a/sys/arch/arm/xscale/iopi2cvar.h
+++ b/sys/arch/arm/xscale/iopi2cvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iopi2cvar.h,v 1.2 2006/07/10 15:39:56 drahn Exp $ */
+/* $OpenBSD: iopi2cvar.h,v 1.3 2009/03/27 16:02:41 oga Exp $ */
/* $NetBSD: iopi2cvar.h,v 1.2 2005/12/11 12:16:51 christos Exp $ */
/*
@@ -47,7 +47,7 @@ struct iopiic_softc {
void *sc_ih;
struct i2c_controller sc_i2c;
- struct lock sc_buslock;
+ struct rwlock sc_buslock;
uint32_t sc_icr;
};