mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
Runs the unmodified upstream Linux amdgpu and amdkfd drivers on Apple Silicon Macs inside a DriverKit system extension, for AMD GPUs attached over Thunderbolt. The Linux sources come from a pinned submodule and are compiled against linuxu, a userspace implementation of the Linux kernel APIs they use. Includes the HSA runtime, the host installer app, the setup and firmware fetch scripts, and the offline test suite.
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
/* linuxu: SHIM (third_party/linux/include/linux/cpufreq.h) — cpufreq API
|
|
* surface for kfd_topology.c. Single-node userspace model: fixed 3 GHz
|
|
* report so the unmodified .c compiles. */
|
|
#ifndef __LINUX_CPUFREQ_H
|
|
#define __LINUX_CPUFREQ_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct cpufreq_policy;
|
|
struct cpufreq_freqs;
|
|
struct cpufreq_driver;
|
|
struct device;
|
|
|
|
struct cpufreq_freqs {
|
|
struct cpufreq_policy *policy;
|
|
unsigned int old;
|
|
unsigned int new;
|
|
};
|
|
|
|
struct cpufreq_policy {
|
|
unsigned int cpu;
|
|
int related_cpus;
|
|
unsigned int min;
|
|
unsigned int max;
|
|
unsigned int cur;
|
|
};
|
|
|
|
struct cpufreq_driver {
|
|
int (*target)(unsigned int cpu, unsigned int freq,
|
|
unsigned int relation);
|
|
};
|
|
|
|
extern unsigned int cpufreq_kget_policy(struct cpufreq_policy **policy);
|
|
extern void cpufreq_kput_policy(struct cpufreq_policy *policy);
|
|
|
|
static inline unsigned int cpufreq_quick_get_max(int cpu)
|
|
{
|
|
(void)cpu;
|
|
return 3000; /* kHz — fixed userspace report */
|
|
}
|
|
|
|
static inline unsigned int cpufreq_kget_cpu_possible(struct cpufreq_policy *policy)
|
|
{
|
|
(void)policy;
|
|
return 1;
|
|
}
|
|
|
|
static inline unsigned int cpufreq_kget_cpu_allowed(struct cpufreq_policy *policy)
|
|
{
|
|
(void)policy;
|
|
return 1;
|
|
}
|
|
|
|
static inline unsigned int cpufreq_kget_policy_cur(struct cpufreq_policy *policy)
|
|
{
|
|
return policy->cur;
|
|
}
|
|
|
|
#endif /* __LINUX_CPUFREQ_H */
|