PERFORCE change 102058 for review

Suleiman Souhlal ssouhlal at FreeBSD.org
Fri Jul 21 16:17:52 UTC 2006


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

Change 102058 by ssouhlal at ssouhlal-maho on 2006/07/21 16:17:11

	Implement spinlock_enter() and spinlock_exit().
	This makes a MALTA kernel with INVARIANTS and WITNESS go to the
	"mountroot>" prompt without panicking.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/machdep.c#18 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#18 (text+ko) ====

@@ -284,13 +284,25 @@
 void
 spinlock_enter(void)
 {
+	struct thread *td;
 
+	td = curthread;
+	if (td->td_md.md_spinlock_count == 0)
+		td->td_md.md_saved_sr = intr_disable();
+	td->td_md.md_spinlock_count++;
+	critical_enter();
 }
 
 void
 spinlock_exit(void)
 {
+	struct thread *td;
 
+	td = curthread;
+	critical_exit();
+	td->td_md.md_spinlock_count--;
+	if (td->td_md.md_spinlock_count == 0)
+		intr_restore(td->td_md.md_saved_sr);
 }
 
 void


More information about the p4-projects mailing list