diff options
-rw-r--r-- | sys/dev/ic/ami.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/amivar.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/ami_pci.c | 3 |
3 files changed, 11 insertions, 10 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index b437229ca41..b28ff40d6b4 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.175 2006/12/23 17:46:39 deraadt Exp $ */ +/* $OpenBSD: ami.c,v 1.176 2007/01/27 05:09:51 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -58,7 +58,7 @@ #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/proc.h> -#include <sys/lock.h> +#include <sys/rwlock.h> #include <machine/bus.h> @@ -538,7 +538,7 @@ ami_attach(struct ami_softc *sc) "disk\n", DEVNAME(sc)); /* lock around ioctl requests */ - lockinit(&sc->sc_lock, PZERO, DEVNAME(sc), 0, 0); + rw_init(&sc->sc_lock, NULL); bzero(&saa, sizeof(saa)); saa.saa_sc_link = &sc->sc_link; @@ -1705,7 +1705,7 @@ ami_drv_inq(struct ami_softc *sc, u_int8_t ch, u_int8_t tg, u_int8_t page, int error = 0; int s; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); + rw_enter_write(&sc->sc_lock); s = splbio(); ccb = ami_get_ccb(sc); @@ -1772,7 +1772,7 @@ ptmemerr: splx(s); err: - lockmgr(&sc->sc_lock, LK_RELEASE, NULL); + rw_exit_write(&sc->sc_lock); return (error); } @@ -1787,7 +1787,7 @@ ami_mgmt(struct ami_softc *sc, u_int8_t opcode, u_int8_t par1, u_int8_t par2, int error = 0; int s; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); + rw_enter_write(&sc->sc_lock); s = splbio(); ccb = ami_get_ccb(sc); @@ -1845,7 +1845,7 @@ memerr: splx(s); err: - lockmgr(&sc->sc_lock, LK_RELEASE, NULL); + rw_exit_write(&sc->sc_lock); return (error); } diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h index c0152037f7d..5187bb50fe6 100644 --- a/sys/dev/ic/amivar.h +++ b/sys/dev/ic/amivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amivar.h,v 1.50 2006/12/23 17:46:39 deraadt Exp $ */ +/* $OpenBSD: amivar.h,v 1.51 2007/01/27 05:09:51 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -121,7 +121,7 @@ struct ami_softc { struct timeout sc_run_tmo; int sc_dis_poll; - struct lock sc_lock; + struct rwlock sc_lock; char sc_fwver[16]; char sc_biosver[16]; diff --git a/sys/dev/pci/ami_pci.c b/sys/dev/pci/ami_pci.c index ee328eca3fd..42200717b80 100644 --- a/sys/dev/pci/ami_pci.c +++ b/sys/dev/pci/ami_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami_pci.c,v 1.41 2006/08/06 04:40:08 brad Exp $ */ +/* $OpenBSD: ami_pci.c,v 1.42 2007/01/27 05:09:51 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -31,6 +31,7 @@ #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/device.h> +#include <sys/rwlock.h> #include <dev/pci/pcidevs.h> #include <dev/pci/pcivar.h> |