summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_switch.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-03-20 17:05:12 +0000
committerrwatson <rwatson@FreeBSD.org>2005-03-20 17:05:12 +0000
commit560261414f223fefc28f7e043117aabc1a6e007c (patch)
treeaa7616cf7326c05621b44911a424730b38d9a84d /sys/kern/kern_switch.c
parent31df036c3c74228d1fc90c7f5fb79903ba4bb90e (diff)
downloadFreeBSD-src-560261414f223fefc28f7e043117aabc1a6e007c.zip
FreeBSD-src-560261414f223fefc28f7e043117aabc1a6e007c.tar.gz
Add a read-only kern.sched.preemption sysctl so that user space can tell
if "options PREEMPTION" is compiled into the kernel.
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r--sys/kern/kern_switch.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index 3a7dd82..24a29cb 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -120,6 +120,19 @@ CTASSERT((RQB_BPW * RQB_LEN) == RQ_NQS);
#define td_kse td_sched
+/*
+ * kern.sched.preemption allows user space to determine if preemption support
+ * is compiled in or not. It is not currently a boot or runtime flag that
+ * can be changed.
+ */
+#ifdef PREEMPTION
+static int kern_sched_preemption = 1;
+#else
+static int kern_sched_preemption = 0;
+#endif
+SYSCTL_INT(_kern_sched, OID_AUTO, preemption, CTLFLAG_RD,
+ &kern_sched_preemption, 0, "Kernel preemption enabled");
+
/************************************************************************
* Functions that manipulate runnability from a thread perspective. *
************************************************************************/
OpenPOWER on IntegriCloud