0

我想知道如何访问我的 driver/driver.c 中的 name 成员这是来自 include/linux/cpufreq.h 的代码

struct cpufreq_governor {
    char    name[CPUFREQ_NAME_LEN];
    int     (*governor) (struct cpufreq_policy *policy,
                 unsigned int event);
    ssize_t (*show_setspeed)    (struct cpufreq_policy *policy,
                     char *buf);
    int     (*store_setspeed)   (struct cpufreq_policy *policy,
                     unsigned int freq);
    unsigned int max_transition_latency; /* HW must be able to switch to
            next freq faster than this value in nano secs or we
            will fallback to performance governor */
    struct list_head    governor_list;
    struct module       *owner;
};

driver.c 有一个依赖于活动调控器的功能。那么如何在 driver.c 中将其作为变量

4

1 回答 1

0

Cpufreq 导出符号cpufreq_get_policy,您可以使用它获取策略。cpufreq_policy有一个成员governor。这就是你要找的。

于 2013-07-19T16:52:00.440 回答