mirror of
https://github.com/cyring/CoreFreq.git
synced 2025-07-23 12:13:07 +02:00
[Kernel][6.15] Fix missing cpufreq_get_policy
and asm/amd/nb.h
This commit is contained in:
@@ -2298,6 +2298,26 @@ static PROCESSOR_SPECIFIC *LookupProcessor(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
static int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
|
||||
|
||||
if (!policy)
|
||||
return -EINVAL;
|
||||
|
||||
cpu_policy = cpufreq_cpu_get(cpu);
|
||||
if (!cpu_policy)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(policy, cpu_policy, sizeof(*policy));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_CPU_FREQ */
|
||||
|
||||
static void Query_DeviceTree(unsigned int cpu)
|
||||
{
|
||||
CORE_RO *Core = (CORE_RO *) PUBLIC(RO(Core, AT(cpu)));
|
||||
|
@@ -958,6 +958,26 @@ static PROCESSOR_SPECIFIC *LookupProcessor(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
static int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
|
||||
|
||||
if (!policy)
|
||||
return -EINVAL;
|
||||
|
||||
cpu_policy = cpufreq_cpu_get(cpu);
|
||||
if (!cpu_policy)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(policy, cpu_policy, sizeof(*policy));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_CPU_FREQ */
|
||||
|
||||
static void Query_DeviceTree(unsigned int cpu)
|
||||
{
|
||||
CORE_RO *Core = (CORE_RO *) PUBLIC(RO(Core, AT(cpu)));
|
||||
|
@@ -942,6 +942,26 @@ static PROCESSOR_SPECIFIC *LookupProcessor(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
static int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
|
||||
|
||||
if (!policy)
|
||||
return -EINVAL;
|
||||
|
||||
cpu_policy = cpufreq_cpu_get(cpu);
|
||||
if (!cpu_policy)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(policy, cpu_policy, sizeof(*policy));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_CPU_FREQ */
|
||||
|
||||
static void Query_DeviceTree(unsigned int cpu)
|
||||
{
|
||||
CORE_RO *Core = (CORE_RO *) PUBLIC(RO(Core, AT(cpu)));
|
||||
|
@@ -53,8 +53,12 @@
|
||||
#endif /* CONFIG_XEN */
|
||||
#include <asm/mwait.h>
|
||||
#ifdef CONFIG_AMD_NB
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
#include <asm/amd/nb.h>
|
||||
#else
|
||||
#include <asm/amd_nb.h>
|
||||
#endif
|
||||
#endif /* CONFIG_AMD_NB */
|
||||
#ifdef CONFIG_ACPI
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/processor.h>
|
||||
@@ -20826,6 +20830,26 @@ static void Stop_Uncore_AMD_Family_17h(void *arg)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||
static int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
|
||||
|
||||
if (!policy)
|
||||
return -EINVAL;
|
||||
|
||||
cpu_policy = cpufreq_cpu_get(cpu);
|
||||
if (!cpu_policy)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(policy, cpu_policy, sizeof(*policy));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_CPU_FREQ */
|
||||
|
||||
static long Sys_OS_Driver_Query(void)
|
||||
{
|
||||
int rc = RC_SUCCESS;
|
||||
|
Reference in New Issue
Block a user