Chinese translated version of Documentation/timers/hpet
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: 799942107@qq.com
---------------------------------------------------------------------
Documentation/timers/hpet的中文翻译
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。
中文版维护者: 黄佳露 799942107@qq.com
中文版翻译者: 黄佳露 799942107@qq.com
中文版校译者: 潘丽卡 774945605@qq.com
以下为正文
---------------------------------------------------------------------
High Precision Event Timer Driver for Linux
The High Precision Event Timer (HPET) hardware follows a specification
by Intel and Microsoft which can be found at
高精度事件计时器(HPET)硬件遵循因特尔和微软的规格,这个可以在下面
的网址中找到。
http://www.intel.com/hardwaredesign/hpetspec_1.pdf
Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision")
and up to 32 comparators. Normally three or more comparators are provided,
each of which can generate oneshot interrupts and at least one of which has
additional hardware to support periodic interrupts. The comparators are
also called "timers", which can be misleading since usually timers are
independent of each other ... these share a counter, complicating resets.
每个HPET都有一个固定频率计数器(最低时钟频率为10MHz),最多可有32个
比较器。一般都会有提供三个及以上的比较器,每个都可以生成单触发中
断和至少一个额外的硬件,用来支持周期性中断。比较器有另一个说法叫
"计时器",这个说法可能会有误导因为计时器一般是相互独立的。这些比较器
共享一个计数器和复杂的重置。
HPET devices can support two interrupt routing modes. In one mode, the
comparators are additional interrupt sources with no particular system
role. Many x86 BIOS writers don't route HPET interrupts at all, which
prevents use of that mode. They support the other "legacy replacement"
mode where the first two comparators block interrupts from 8254 timers
and from the RTC.
HPER设备可以支持两个中断路由模式。在其中一种模式下,如果没有特
定系统,比较器就是额外的中断源。所以许多x86 BIOS的作者,不要发送
HPET中断,因为这个中断禁止使用那种模式。他们支持的另外一种叫“遗
留替换”的模式,这种模式下,前两个比较器块可以从8254计时器和RTC中断。
The driver supports detection of HPET driver allocation and initialization
of the HPET before the driver module_init routine is called. This enables
platform code which uses timer 0 or 1 as the main timer to intercept HPET
initialization. An example of this initialization can be found in
arch/x86/kernel/hpet.c.
在驱动设备module_init的程序被引用前,驱动程序支持检测HPET的驱动设备和
初始化。这个可以使平台代码阻止HPET初始化,该平台代码使用0或1作为主
要计数器。相关的初始化例子可以从arch/x86/kernel/hpet.c.中找到。
The driver provides a userspace API which resembles the API found in the
RTC driver framework. An example user space program is provided in
file:Documentation/timers/hpet_example.c
驱动程序提供了API用户空间,类似于在RTC驱动程序框架中找到的API。下面的
文件中可以找到用户空间程序的例子。