cpufreq.h

来自「这是一个SIGMA方案的PMP播放器的UCLINUX程序,可播放DVD,VCD,」· C头文件 代码 · 共 91 行

H
91
字号
/* *  linux/include/linux/cpufreq.h * *  Copyright (C) 2001 Russell King * * $Id: cpufreq.h,v 1.2 2001/08/12 15:40:23 rmk Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#ifndef _LINUX_CPUFREQ_H#define _LINUX_CPUFREQ_H#include <linux/config.h>#include <linux/notifier.h>#ifndef CONFIG_SMP#define cpufreq_current(cpu)	((void)(cpu), __cpufreq_cur)#define cpufreq_max(cpu)	((void)(cpu), __cpufreq_max)#else/* * Should be something like: * * typedef struct { *	u_int current; *	u_int max; *	u_int min; * } __cacheline_aligned cpufreq_info_t; * * static cpufreq_info_t cpufreq_info; * * #define cpufreq_current(cpu)	(cpufreq_info[cpu].current) * #define cpufreq_max(cpu)	(cpufreq_info[cpu].max) * * Maybe we should find some other per-cpu structure to * bury this in? */#error fill in SMP version#endifstruct cpufreq_info {	unsigned int old_freq;	unsigned int new_freq;};/* * The max and min frequency rates that the registered device * can tolerate.  Never set any element this structure directly - * always use cpu_updateminmax. */struct cpufreq_minmax {	unsigned int min_freq;	unsigned int max_freq;	unsigned int cur_freq;	unsigned int new_freq;};static inlinevoid cpufreq_updateminmax(void *arg, unsigned int min, unsigned int max){	struct cpufreq_minmax *minmax = arg;	if (minmax->min_freq < min)		minmax->min_freq = min;	if (minmax->max_freq > max)		minmax->max_freq = max;}#define CPUFREQ_MINMAX		(0)#define CPUFREQ_PRECHANGE	(1)#define CPUFREQ_POSTCHANGE	(2)int cpufreq_register_notifier(struct notifier_block *nb);int cpufreq_unregister_notifier(struct notifier_block *nb);int cpufreq_setmax(void);int cpufreq_set(unsigned int khz);unsigned int cpufreq_get(int cpu);void cpufreq_init(unsigned int khz);/* * The following are the architecture specific * parts of the cpu frequency subsystem.  Note that * cpu_validatespeed may not return an error. */unsigned int cpufreq_validatespeed(unsigned int khz);void cpufreq_setspeed(unsigned int khz);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?