PERFORCE change 109479 for review

Olivier Houchard cognet at FreeBSD.org
Tue Nov 7 21:33:07 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=109479

Change 109479 by cognet at cognet on 2006/11/07 21:32:51

	Introduce ixpnpe_start_locked(), to be used from ixpnpe_init(), where
	we already hold the lock.
	Approved by:	mux (mentor)

Affected files ...

.. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#4 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#4 (text+ko) ====

@@ -329,25 +329,34 @@
     return error;
 }
 
-int
-ixpnpe_start(struct ixpnpe_softc *sc)
+static int
+ixpnpe_start_locked(struct ixpnpe_softc *sc)
 {
     int error;
 
-    mtx_lock(&sc->sc_mtx);
     if (!sc->started) {
 	error = npe_cpu_start(sc);
 	if (error == 0)
 	    sc->started = 1;
     } else
 	error = 0;
-    mtx_unlock(&sc->sc_mtx);
 
     DPRINTF(sc->sc_dev, "%s: error %d\n", __func__, error);
     return error;
 }
 
 int
+ixpnpe_start(struct ixpnpe_softc *sc)
+{
+	int ret;
+
+	mtx_lock(&sc->sc_mtx);
+	ret = ixpnpe_start_locked(sc);
+	mtx_unlock(&sc->sc_mtx);
+	return (ret);
+}
+
+int
 ixpnpe_stop(struct ixpnpe_softc *sc)
 {
     int error;
@@ -450,7 +459,7 @@
     error = npe_load_image(sc, imageCodePtr, 1 /*VERIFY*/);
     if (error == 0) {
 	sc->validImage = 1;
-	error = ixpnpe_start(sc);
+	error = ixpnpe_start_locked(sc);
     } else {
 	sc->validImage = 0;
     }


More information about the p4-projects mailing list