summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_cpu.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-23 22:37:36 +0000
committerjhb <jhb@FreeBSD.org>2001-10-23 22:37:36 +0000
commit8d38ba142e638e2f86a8fa7462cd134aa9138de7 (patch)
tree6aec37780619a8a816ac02da6e2ac49257c7a0d7 /sys/dev/acpica/acpi_cpu.c
parent48f17fd6c7037b087d60898d531d428b85703f1d (diff)
downloadFreeBSD-src-8d38ba142e638e2f86a8fa7462cd134aa9138de7.zip
FreeBSD-src-8d38ba142e638e2f86a8fa7462cd134aa9138de7.tar.gz
Allow hw.acpi.cpu.{economy,performance}_speed to be set from the loader
via tunables.
Diffstat (limited to 'sys/dev/acpica/acpi_cpu.c')
-rw-r--r--sys/dev/acpica/acpi_cpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index ad88620..7860d73 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -255,6 +255,7 @@ acpi_cpu_attach(device_t dev)
static void
acpi_cpu_init_throttling(void *arg)
{
+ int cpu_temp_speed;
ACPI_LOCK;
@@ -267,6 +268,14 @@ acpi_cpu_init_throttling(void *arg)
cpu_economy_state = cpu_performance_state / 2;
if (cpu_economy_state == 0) /* 0 is 'reserved' */
cpu_economy_state++;
+ if (TUNABLE_INT_FETCH("hw.acpi.cpu.performance_speed",
+ &cpu_temp_speed) && cpu_temp_speed > 0 &&
+ cpu_temp_speed <= cpu_max_state)
+ cpu_performance_state = cpu_temp_speed;
+ if (TUNABLE_INT_FETCH("hw.acpi.cpu.economy_speed",
+ &cpu_temp_speed) && cpu_temp_speed > 0 &&
+ cpu_temp_speed <= cpu_max_state)
+ cpu_economy_state = cpu_temp_speed;
/* register performance profile change handler */
EVENTHANDLER_REGISTER(powerprofile_change, acpi_cpu_powerprofile, NULL, 0);
OpenPOWER on IntegriCloud