Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174318696
D58845.id186491.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
854 B
Referenced Files
None
Subscribers
None
D58845.id186491.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/cpufreq.h b/sys/compat/linuxkpi/common/include/linux/cpufreq.h
new file mode 100644
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/cpufreq.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2026 FreeBSD Foundation
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#ifndef _LINUX_CPUFREQ_H_
+#define _LINUX_CPUFREQ_H_
+
+#include <sys/pcpu.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+
+static inline unsigned int
+cpufreq_quick_get_max(unsigned int cpu __unused)
+{
+ int clockrate = 0;
+ size_t len = sizeof(clockrate);
+
+ if (kernel_sysctlbyname(curthread, "hw.clockrate", &clockrate, &len,
+ NULL, 0, NULL, 0) == 0 && clockrate > 0) {
+ return ((unsigned int)clockrate * 1000);
+ }
+
+ /* Fall back to 1.0 GHz in KHz */
+ return (1000000);
+}
+
+#endif /* _LINUX_CPUFREQ_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 8:36 AM (20 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38821682
Default Alt Text
D58845.id186491.diff (854 B)
Attached To
Mode
D58845: LinuxKPI: Add cpufreq_quick_get_max to LinuxKPI for amdkfd support
Attached
Detach File
Event Timeline
Log In to Comment