git: 592bf2412662 - stable/15 - hwpstate_intel: Fix i386 build

ShengYi Hung <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a64b744.27c35.3a983fa8__2019.51034120924$1784985434$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by aokblast:

URL: https://cgit.FreeBSD.org/src/commit/?id=592bf24126623d5c6b3ba689077cd4565b61058a

commit 592bf24126623d5c6b3ba689077cd4565b61058a
Author:     Harry Schmalzb <[email protected]>
AuthorDate: 2026-07-13 05:29:34 +0000
Commit:     ShengYi Hung <[email protected]>
CommitDate: 2026-07-25 13:13:24 +0000

    hwpstate_intel: Fix i386 build
    
    Reviewed by:    olce
    Fixes:  7b26353a59d6
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D58208
    
    (cherry picked from commit bdc0f7678257eaa739b9c816285504470e71e3de)
---
 sys/x86/cpufreq/hwpstate_intel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c
index db8600d7b89a..99741f66b986 100644
--- a/sys/x86/cpufreq/hwpstate_intel.c
+++ b/sys/x86/cpufreq/hwpstate_intel.c
@@ -326,13 +326,19 @@ intel_hwpstate_hybrid_cb(void *ctx)
 {
 	uint32_t *small_cores = ctx;
 
+#ifdef __i386__
+	(void)small_cores;
+#else
 	atomic_add_32(small_cores, PCPU_GET(small_core));
+#endif
 }
 
 void
 intel_hwpstate_identify(driver_t *driver, device_t parent)
 {
+#ifndef __i386__
 	uint32_t small_cores = 0;
+#endif
 
 	if (device_find_child(parent, "hwpstate_intel", DEVICE_UNIT_ANY) != NULL)
 		return;
@@ -353,6 +359,7 @@ intel_hwpstate_identify(driver_t *driver, device_t parent)
 	if ((cpu_power_eax & CPUTPM1_HWP) == 0)
 		return;
 
+#ifndef __i386__
 	/*
 	 * On hybrid-core systems, package-level control cannot be used.
 	 * It may cause all cores to run at the E-core frequency because
@@ -363,6 +370,7 @@ intel_hwpstate_identify(driver_t *driver, device_t parent)
 	    intel_hwpstate_hybrid_cb, smp_no_rendezvous_barrier, &small_cores);
 	if (small_cores > 0 && small_cores < mp_ncores)
 		hwpstate_pkg_ctrl_enable = false;
+#endif
 
 	if (BUS_ADD_CHILD(parent, 10, "hwpstate_intel", device_get_unit(parent))
 	    == NULL)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.