summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2015-08-26 23:58:03 +0000
committerimp <imp@FreeBSD.org>2015-08-26 23:58:03 +0000
commitb82b5280a125237c8e88f66e7beae3a5925da9c3 (patch)
tree84f35f5ba3f71b1d1b0d906df72e847ff9ea5422 /sys/kern/init_main.c
parent4c1edcc0740486fd6b30a0e53dd89199de14acc8 (diff)
downloadFreeBSD-src-b82b5280a125237c8e88f66e7beae3a5925da9c3.zip
FreeBSD-src-b82b5280a125237c8e88f66e7beae3a5925da9c3.tar.gz
When the kernel is compiled with INVARIANTS, export that as
debug.invariants. Differential Revision: https://reviews.freebsd.org/D3488 MFC after: 3 days
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index efb7317..2f83d81 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -117,6 +117,15 @@ int bootverbose = BOOTVERBOSE;
SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
"Control the output of verbose kernel messages");
+/* Want to avoid defining INVARIANTS if not already defined */
+#ifdef INVARIANTS
+static int invariants = 1;
+#else
+static int invariants = 0;
+#endif
+SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0,
+ "Kernel compiled with invariants");
+
/*
* This ensures that there is at least one entry so that the sysinit_set
* symbol is not undefined. A sybsystem ID of SI_SUB_DUMMY is never
OpenPOWER on IntegriCloud