aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-06-24 20:14:12 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-06-25 00:27:24 +0000
commit66d48f02de0fbf4d8efb3d4edc69f37c54f130fd (patch)
tree69dc2efecc272a7127f9e9e48634b72ea6702620
parent3377f38cfe284a8490b49611614aae3a2bea78e4 (diff)
hwpstate_intel(4): Comment the EPB to EPP computation
Explain why the '* 17' instead of '* 16', as suggested in revision D55629. Event: Halifax Hackathon 202606 Location: jrm@'s living room Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/x86/cpufreq/hwpstate_intel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c
index b18f1b674d22..6d3100217365 100644
--- a/sys/x86/cpufreq/hwpstate_intel.c
+++ b/sys/x86/cpufreq/hwpstate_intel.c
@@ -254,6 +254,10 @@ out:
return (ret);
}
+/*
+ * Multiplying by 17 here allows to send [0;15] to the full [0;255] range (so
+ * 255 is reported when EPB is set to 15, instead of 240).
+ */
#define EPB_TO_EPP(x) ((x) * 17)
#define EPP_TO_EPB(x) ((x) >> 4)