Linux/Documentation/cpu-freq/core.txt

来源:互联网 发布:ug软件图片 编辑:程序博客网 时间:2024/05/17 04:51

Chinese translated version of Documentation/cpu-freq/core.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: Liemin Ma <maliemin.jj@gmail.com>
---------------------------------------------------------------------
Documentation/cpu-freq/core.txt 的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者:  马列敏 <maliemin.jj@gmail.com>
中文版翻译者:  马列敏<maliemin.jj@gmail.com>
中文版校译者:  马列敏<maliemin.jj@gmail.com>


以下为正文
---------------------------------------------------------------------

1

CPU frequency and voltage scaling code inthe Linux(TM) kernel

CPU频率和在Linux内核(TM)里的电压缩放代码

  2

  3

  4                          L i n ux    C P U F r e q

  5

  6                           C P U Fr e q    C o r e

  7

  8

  9                     DominikBrodowski  <linux@brodo.de>

 10                      David Kimdon<dwhedon@debian.org>

 11

 12

 13

 14    Clock scaling allows you tochange the clock speed of the CPUs on the

 15     fly. This is a nice method tosave battery power, because the lower

 16             the clock speed, theless power the CPU consumes.

时钟分频扩展可以让你改变cpu的时钟速度。这是一个很好的方法来节省电池电量,因为时钟速度越低,CPU消耗的功率越少。

 17

 18

 19 Contents:

内容:

 20 ---------

 21 1.  CPUFreq core and interfaces

CPUFreq核心和接口

 22 2.  CPUFreq notifiers

CPUFreq通知器

 23

 24 1. General Information

1.基本资料

 25 =======================

 26

 27 The CPUFreq core code is located in drivers/cpufreq/cpufreq.c. This

 28 cpufreq code offers a standardized interface for the CPUFreq

 29 architecture drivers (those pieces of code that do actual

 30 frequency transitions), as well as to "notifiers". These aredevice

 31 drivers or other part of the kernel that need to be informed of

 32 policy changes (ex. thermal modules like ACPI) or of all

 33 frequency changes (ex. timing code) or even need to force certain

 34 speed limits (like LCD drivers on ARM architecture). Additionally, the

 35 kernel "constant" loops_per_jiffy is updated on frequencychanges

 36 here.

CPUFreq核心代码位于驱动器/ CPUFreq / cpufreq.c。 这

cpufreq为cpufreq架构提供一个标准化接口驱动程序代码(这些部分的代码,做实际的频率转换),以及“通知”。这些是设备驱动程序或其他内核的一部分,需要了解政策变化的部分(如热模块如ACPI)或频率变化(仓库计时代码),甚至需要强迫某些限速(如液晶驱动臂架构)。另外,内核“常数”loops_per_jiffy在这里是用来更新频率变化。

 

 37

 38 Reference counting is done by cpufreq_get_cpu and cpufreq_put_cpu,

 39 which make sure that the cpufreq processor driver is correctly

 40 registered with the core, and will not be unloaded until

 41 cpufreq_put_cpu is called.

参考计数是由cpufreq_get_cpu 和cpufreq_put_cpu来完成,以确保cpufreq处理器驱动程序正确地注册到核心,并且不会被卸载,直到cpufreq_put_cpu被调用。

 42

 43 2. CPUFreq notifiers

  2.CPUFreq通知器

 44 ====================

 45

 46 CPUFreq notifiers conform to the standard kernel notifier interface.

 47 See linux/include/linux/notifier.h for details on notifiers.

CPUFreq通知符合标准内核通知接口.可以在该通知器上看到linux/include/linux/notifier.h通知程序的详细信息

 48

 49 There are two different CPUFreq notifiers - policy notifiers and

 50 transition notifiers.

   这里有两种不同的CPUFreq通知器——政策通知器和过渡通知器

 51

 52

 53 2.1 CPUFreq policy notifiers

2.1 CPUFreq 政策通知器

 54 ----------------------------

 55

 56 These are notified when a new policy is intended to be set. Each

 57 CPUFreq policy notifier is called three times for a policy transition:

当一个新的政策意图被进行设置的时候,这些就会被通知。每一个的CPUFreq政策通知器都会因为政策转变而被调用三次:

 58

 59 1.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if

 60     they see a need for this -may it be thermal considerations or

 61     hardware limitations.

  1.CPUFREQ_ADJUST所有的CPUFreq通知者可能会改变的极限,如果他们看到一个需要——它可能是热考虑或硬件的限制。

 62

 63 2.) During CPUFREQ_INCOMPATIBLE only changes may be done in order toavoid

 64     hardware failure.
2.
)在CPUFREQ_INCOMPATIBLE唯一的改变可能是为了避免出现硬件故障。

 65

 66 3.) And during CPUFREQ_NOTIFY all notifiers are informed of the newpolicy

 67    - if two hardware driversfailed to agree on a new policy before this

 68    stage, the incompatiblehardware shall be shut down, and the user

 69    informed of this.

3.在CPUFREQ_NOTIFY所有的通知都会被告知新政策——如果两个硬件驱动程序失败这之前达成一项新政策,在这个阶段之前,不兼容的硬件将被关闭,并且用户也会被获悉此事。

 70

 71 The phase is specified in the second argument to the notifier.

在第二个参数中指定的阶段是通知。

 72

 73 The third argument, a void *pointer, points to a struct cpufreq_policy

 74 consisting of five values: cpu, min, max, policy and max_cpu_freq. min

 75 and max are the lower and upper frequencies (in kHz) of the new

 76 policy, policy the new policy, cpu the number of the affected CPU; and

 77 max_cpu_freq the maximum supported CPU frequency. This value is given

 78 for informational purposes only.

第三个参数,一个void *pointer,指向一个由CPU,最小值,最大值,政策和max_cpu_freq这五个值组成的struct cpufreq_policy。 min和max是上下频率(赫兹)的新政策,,政策的新政策,cpu的数量影响cpu;max_cpu_freq给出支持的最大cpu频率。该值仅供参考。

 79

 80

 81 2.2 CPUFreq transition notifiers

2.2 CPUFreq过渡通知器

 82 --------------------------------

 83

 84 These are notified twice when the CPUfreq driver switches the CPU core

 85 frequency and this change has any external implications.

CPUfreq驱动开关CPU核心频率并且这种变化有任何外部影响时,这些将会被通知两次。

 86

 87 The second argument specifies the phase - CPUFREQ_PRECHANGE or

 88 CPUFREQ_POSTCHANGE.

第二个参数指定阶段——CPUFREQ_PRECHANGECPUFREQ_POSTCHANGE

 89

 90 The third argument is a struct cpufreq_freqs with the following

 91 values:

第三个参数是一个有以下值的structcpufreq_freqs。

 92 cpu     - number of the affectedCPU

 93 old     - old frequency

 94 new     - new frequency

Cpu   -受影响的CPU数量

  - 旧频率

   -新频率

 95

 96 If the cpufreq core detects the frequency has changed while the system

 97 was suspended, these notifiers are called with CPUFREQ_RESUMECHANGE as

 98 second argument.

当系统暂停时,如果cpufreq核心检测到频率发生了改变,那么这些作为第二个参数的通知程序就会被称为CPUFREQ_RESUMECHANGE


0 0
原创粉丝点击