Date: Fri, 21 Jul 2006 16:17:51 GMT From: Suleiman Souhlal <ssouhlal@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 102058 for review Message-ID: <200607211617.k6LGHpA9074889@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102058 Change 102058 by ssouhlal@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607211617.k6LGHpA9074889>