⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 core.txt

📁 linux 内核源代码
💻 TXT
字号:
     CPU frequency and voltage scaling code in the Linux(TM) kernel		         L i n u x    C P U F r e q			  C P U F r e q    C o r e		    Dominik Brodowski  <linux@brodo.de>		     David Kimdon <dwhedon@debian.org>   Clock scaling allows you to change the clock speed of the CPUs on the    fly. This is a nice method to save battery power, because the lower            the clock speed, the less power the CPU consumes.Contents:---------1.  CPUFreq core and interfaces2.  CPUFreq notifiers1. General Information=======================The CPUFreq core code is located in drivers/cpufreq/cpufreq.c. Thiscpufreq code offers a standardized interface for the CPUFreqarchitecture drivers (those pieces of code that do actualfrequency transitions), as well as to "notifiers". These are devicedrivers or other part of the kernel that need to be informed ofpolicy changes (ex. thermal modules like ACPI) or of allfrequency changes (ex. timing code) or even need to force certainspeed limits (like LCD drivers on ARM architecture). Additionally, thekernel "constant" loops_per_jiffy is updated on frequency changeshere.Reference counting is done by cpufreq_get_cpu and cpufreq_put_cpu,which make sure that the cpufreq processor driver is correctlyregistered with the core, and will not be unloaded untilcpufreq_put_cpu is called.2. CPUFreq notifiers====================CPUFreq notifiers conform to the standard kernel notifier interface.See linux/include/linux/notifier.h for details on notifiers.There are two different CPUFreq notifiers - policy notifiers andtransition notifiers.2.1 CPUFreq policy notifiers----------------------------These are notified when a new policy is intended to be set. EachCPUFreq policy notifier is called three times for a policy transition:1.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if    they see a need for this - may it be thermal considerations or    hardware limitations.2.) During CPUFREQ_INCOMPATIBLE only changes may be done in order to avoid    hardware failure.3.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy   - if two hardware drivers failed to agree on a new policy before this   stage, the incompatible hardware shall be shut down, and the user   informed of this.The phase is specified in the second argument to the notifier.The third argument, a void *pointer, points to a struct cpufreq_policyconsisting of five values: cpu, min, max, policy and max_cpu_freq. min and max are the lower and upper frequencies (in kHz) of the newpolicy, policy the new policy, cpu the number of the affected CPU; and max_cpu_freq the maximum supported CPU frequency. This value is given for informational purposes only.2.2 CPUFreq transition notifiers--------------------------------These are notified twice when the CPUfreq driver switches the CPU corefrequency and this change has any external implications.The second argument specifies the phase - CPUFREQ_PRECHANGE orCPUFREQ_POSTCHANGE.The third argument is a struct cpufreq_freqs with the followingvalues:cpu	- number of the affected CPUold	- old frequencynew	- new frequencyIf the cpufreq core detects the frequency has changed while the systemwas suspended, these notifiers are called with CPUFREQ_RESUMECHANGE assecond argument.

⌨️ 快捷键说明

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