diff options
author | Aleksander Piotrowski <alek@cvs.openbsd.org> | 2006-05-21 20:55:27 +0000 |
---|---|---|
committer | Aleksander Piotrowski <alek@cvs.openbsd.org> | 2006-05-21 20:55:27 +0000 |
commit | bcae92f27f631c876b789e4b6aeaaf90514465a0 (patch) | |
tree | 6e430418269a3b96d4c59a8055fc6fadc567658e | |
parent | 103f174ca31117b512694d8aa62f5f7f2e1272b0 (diff) |
Replace lockmgr with rwlock; help and ok marco@
-rw-r--r-- | sys/dev/ipmi.c | 8 | ||||
-rw-r--r-- | sys/dev/ipmivar.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c index 0a401908af9..5a48390f1b8 100644 --- a/sys/dev/ipmi.c +++ b/sys/dev/ipmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmi.c,v 1.41 2006/05/15 01:10:07 marco Exp $ */ +/* $OpenBSD: ipmi.c,v 1.42 2006/05/21 20:55:26 alek Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave @@ -1342,7 +1342,7 @@ read_sensor(struct ipmi_softc *sc, struct ipmi_sensor *psensor) int rxlen, rv = -1; if (!cold) - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); + rw_enter_write(&sc->sc_lock); memset(data, 0, sizeof(data)); data[0] = psensor->i_num; @@ -1364,7 +1364,7 @@ read_sensor(struct ipmi_softc *sc, struct ipmi_sensor *psensor) rv = 0; done: if (!cold) - lockmgr(&sc->sc_lock, LK_RELEASE, NULL); + rw_exit_write(&sc->sc_lock); return (rv); } @@ -1683,7 +1683,7 @@ ipmi_attach(struct device *parent, struct device *self, void *aux) wdog_register(sc, ipmi_watchdog); /* lock around read_sensor so that no one messes with the bmc regs */ - lockinit(&sc->sc_lock, PZERO, DEVNAME(sc), 0, 0); + rw_init(&sc->sc_lock, DEVNAME(sc)); /* setup ticker */ sc->sc_retries = 0; diff --git a/sys/dev/ipmivar.h b/sys/dev/ipmivar.h index 9171f58e26b..196df24dc6a 100644 --- a/sys/dev/ipmivar.h +++ b/sys/dev/ipmivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmivar.h,v 1.14 2006/05/15 00:50:57 marco Exp $ */ +/* $OpenBSD: ipmivar.h,v 1.15 2006/05/21 20:55:26 alek Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave @@ -31,6 +31,7 @@ #define _IPMIVAR_H_ #include <sys/timeout.h> +#include <sys/rwlock.h> #define IPMI_IF_KCS 1 #define IPMI_IF_SMIC 2 @@ -97,7 +98,7 @@ struct ipmi_softc { int sc_retries; int sc_wakeup; - struct lock sc_lock; + struct rwlock sc_lock; struct ipmi_bmc_args *sc_iowait_args; }; |