summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_mutex.c2
-rw-r--r--sys/kern/sched_4bsd.c2
-rw-r--r--sys/sparc64/sparc64/pmap.c7
-rw-r--r--sys/sys/mutex.h1
4 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 426c1b3..58f2533 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -118,7 +118,6 @@ struct lock_class lock_class_mtx_spin = {
* System-wide mutexes
*/
struct mtx blocked_lock;
-struct mtx sched_lock;
struct mtx Giant;
#ifdef LOCK_PROFILING
@@ -775,7 +774,6 @@ mutex_init(void)
* Initialize mutexes.
*/
mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
- mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE);
mtx_init(&blocked_lock, "blocked lock", NULL, MTX_SPIN);
blocked_lock.mtx_lock = 0xdeadc0de; /* Always blocked. */
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 7e368bb..d96c27e 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -101,6 +101,7 @@ struct td_sched {
((ts)->ts_runq != 0 && (ts)->ts_runq != &runq)
static struct td_sched td_sched0;
+struct mtx sched_lock;
static int sched_tdcnt; /* Total runnable threads in the system. */
static int sched_quantum; /* Roundrobin scheduling quantum in ticks. */
@@ -578,6 +579,7 @@ schedinit(void)
thread0.td_sched = &td_sched0;
thread0.td_lock = &sched_lock;
td_sched0.ts_thread = &thread0;
+ mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE);
}
int
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 58d96db..f8c37d8 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -108,6 +108,13 @@
#define PMAP_SHPGPERPROC 200
#endif
+/* XXX */
+#include "opt_sched.h"
+#ifndef SCHED_4BSD
+#error "sparc64 only works with SCHED_4BSD which uses a global scheduler lock."
+#endif
+extern struct mtx sched_lock;
+
/*
* Virtual and physical address of message buffer.
*/
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 9db89ad..d9a6dee 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -355,7 +355,6 @@ extern struct mtx_pool *mtxpool_sleep;
/*
* Global locks.
*/
-extern struct mtx sched_lock;
extern struct mtx Giant;
extern struct mtx blocked_lock;
OpenPOWER on IntegriCloud