summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorfsmp <fsmp@FreeBSD.org>1997-08-30 08:08:10 +0000
committerfsmp <fsmp@FreeBSD.org>1997-08-30 08:08:10 +0000
commite2310cdbcf324f3bbeda76add82e773d37ee43cd (patch)
treeab2ac308116ca3f26a9055eae17d100d5901e501 /sys/kern
parent62dbf14e9ad4dbe9bc03c2657d854b47ef4b3f65 (diff)
downloadFreeBSD-src-e2310cdbcf324f3bbeda76add82e773d37ee43cd.zip
FreeBSD-src-e2310cdbcf324f3bbeda76add82e773d37ee43cd.tar.gz
Another round of lock pushdown.
Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel. UP kernel expects that this is enough to guarantee exclusive access to regions of code bracketed by these 2 functions. Add a simplelock to bracket clock accesses in clock.c: clock_lock. Help from: Bruce Evans <bde@zeta.org.au>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_smp.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index d5ea71c..955a3a1 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $
+ * $Id: mp_machdep.c,v 1.32 1997/08/30 01:25:13 smp Exp smp $
*/
#include "opt_smp.h"
@@ -1446,8 +1446,16 @@ struct simplelock fast_intr_lock;
/* critical region around INTR() routines */
struct simplelock intr_lock;
+#ifdef SIMPLE_MPINTRLOCK
+/* critical region around INTR() routines */
+struct simplelock mpintr_lock;
+struct simplelock clock_lock;
+#endif
+
+#if 0
/* lock the com (tty) data structures */
struct simplelock com_lock;
+#endif
static void
init_locks(void)
@@ -1459,7 +1467,13 @@ init_locks(void)
mp_lock = 0x00000001;
/* ISR uses its own "giant lock" */
- isr_lock = 0x00000000;
+ isr_lock = FREE_LOCK;
+
+#ifdef SIMPLE_MPINTRLOCK
+ /* lock regions protected in UP kernel via cli/sti */
+ s_lock_init((struct simplelock*)&mpintr_lock);
+ s_lock_init((struct simplelock*)&clock_lock);
+#endif
/* serializes FAST_INTR() accesses */
s_lock_init((struct simplelock*)&fast_intr_lock);
@@ -1470,11 +1484,13 @@ init_locks(void)
/* locks the IO APIC and apic_imen accesses */
s_lock_init((struct simplelock*)&imen_lock);
- /* locks cpl accesses */
+ /* locks cpl/cml/cim/ipending accesses */
s_lock_init((struct simplelock*)&cpl_lock);
+#if 0
/* locks com (tty) data/hardware accesses: a FASTINTR() */
s_lock_init((struct simplelock*)&com_lock);
+#endif
}
OpenPOWER on IntegriCloud