Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/pci Convert simple_lock to mutex.
details: https://anonhg.NetBSD.org/src/rev/fc24c831eb4f
branches: trunk
changeset: 765883:fc24c831eb4f
user: rmind <rmind%NetBSD.org@localhost>
date: Wed Jun 08 22:43:10 2011 +0000
description:
Convert simple_lock to mutex.
diffstat:
sys/arch/i386/pci/viapcib.c | 29 ++++++++++-------------------
1 files changed, 10 insertions(+), 19 deletions(-)
diffs (79 lines):
diff -r 49605f351c5f -r fc24c831eb4f sys/arch/i386/pci/viapcib.c
--- a/sys/arch/i386/pci/viapcib.c Wed Jun 08 22:33:35 2011 +0000
+++ b/sys/arch/i386/pci/viapcib.c Wed Jun 08 22:43:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $ */
+/* $NetBSD: viapcib.c,v 1.13 2011/06/08 22:43:10 rmind Exp $ */
/* $FreeBSD: src/sys/pci/viapm.c,v 1.10 2005/05/29 04:42:29 nyan Exp $ */
/*-
@@ -55,14 +55,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.13 2011/06/08 22:43:10 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/simplelock.h>
+#include <sys/mutex.h>
#include <sys/bus.h>
#include <dev/pci/pcireg.h>
@@ -92,7 +91,7 @@
int sc_revision;
- struct simplelock sc_lock;
+ kmutex_t sc_lock;
};
static int viapcib_match(device_t, cfdata_t, void *);
@@ -172,7 +171,7 @@
goto core_pcib;
}
- simple_lock_init(&sc->sc_lock);
+ mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
val = pci_conf_read(pa->pa_pc, pa->pa_tag, SMB_HOST_CONFIG);
if ((val & 0x10000) == 0) {
@@ -281,13 +280,10 @@
static int
viapcib_acquire_bus(void *opaque, int flags)
{
- struct viapcib_softc *sc;
+ struct viapcib_softc *sc = (struct viapcib_softc *)opaque;
DPRINTF(("viapcib_i2c_acquire_bus(%p, 0x%x)\n", opaque, flags));
-
- sc = (struct viapcib_softc *)opaque;
-
- simple_lock(&sc->sc_lock);
+ mutex_enter(&sc->sc_lock);
return 0;
}
@@ -295,15 +291,10 @@
static void
viapcib_release_bus(void *opaque, int flags)
{
- struct viapcib_softc *sc;
-
- DPRINTF(("viapcib_i2c_release_bus(%p, 0x%x)\n", opaque, flags));
+ struct viapcib_softc *sc = (struct viapcib_softc *)opaque;
- sc = (struct viapcib_softc *)opaque;
-
- simple_unlock(&sc->sc_lock);
-
- return;
+ mutex_exit(&sc->sc_lock);
+ DPRINTF(("viapcib_i2c_release_bus(%p, 0x%x)\n", opaque, flags));
}
static int
Home |
Main Index |
Thread Index |
Old Index