diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-03-20 17:05:12 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-03-20 17:05:12 +0000 |
commit | 560261414f223fefc28f7e043117aabc1a6e007c (patch) | |
tree | aa7616cf7326c05621b44911a424730b38d9a84d /sys | |
parent | 31df036c3c74228d1fc90c7f5fb79903ba4bb90e (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/kern/kern_switch.c | 13 |
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. * ************************************************************************/ |