summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-10-11 16:28:07 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-10-11 16:28:07 +0000
commitfb6cedef0014587351eed1e2b56fe262f7be6b3e (patch)
treeea3b891c41395190573a8843a494424158f15e6c /sys/kern/init_main.c
parentf2ebb4ede8dec3bc7548b216af559167fd74f320 (diff)
resurrect a many year old diff. move CPU throttling into the kernel,
enabled by setting hw.setperf=-1. some other bugs preventing this from going in before have been fixed. my thanks to phessler for keeping the diff alive in the mean time. tested by several to not regress.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index b2922581365..d00ab037998 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.218 2014/10/03 18:06:46 kettenis Exp $ */
+/* $OpenBSD: init_main.c,v 1.219 2014/10/11 16:28:06 tedu Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -116,6 +116,11 @@ struct sigacts sigacts0;
struct process *initprocess;
struct proc *reaperproc;
+#ifndef SMALL_KERNEL
+extern struct timeout setperf_to;
+void auto_setperf(void *);
+#endif
+
int cmask = CMASK;
extern struct user *proc0paddr;
@@ -543,6 +548,10 @@ main(void *framep)
start_init_exec = 1;
wakeup((void *)&start_init_exec);
+#ifndef SMALL_KERNEL
+ timeout_set(&setperf_to, auto_setperf, NULL);
+#endif
+
/*
* proc0: nothing to do, back to sleep
*/