]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
HPET: create /dev/hpetN as a way to access HPET from userland.
authorrpaulo <rpaulo@FreeBSD.org>
Fri, 24 Oct 2014 18:39:15 +0000 (18:39 +0000)
committerrpaulo <rpaulo@FreeBSD.org>
Fri, 24 Oct 2014 18:39:15 +0000 (18:39 +0000)
commit65e80d25cabe5061e1532d06d3c42e874ccebd3a
treefcc3174a70ed3fea6b338938227627ce445dea2a
parent46565044f0ff989e5c6d3cbaee1096368089b589
HPET: create /dev/hpetN as a way to access HPET from userland.

In some cases, TSC is broken and special applications might benefit
from memory mapping HPET and reading the registers to count time.
Most often the main HPET counter is 32-bit only[1], so this only gives
the application a 300 second window based on the default HPET
interval.
Other applications, such as Intel's DPDK, expect /dev/hpet to be
present and use it to count time as well.

Although we have an almost userland version of gettimeofday() which
uses rdtsc in userland, it's not always possible to use it, depending
on how broken the multi-socket hardware is.

Install the acpi_hpet.h so that applications can use the HPET register
definitions.

[1] I haven't found a system where HPET's main counter uses more than
32 bit.  There seems to be a discrepancy in the Intel documentation
(claiming it's a 64-bit counter) and the actual implementation (a
32-bit counter in a 64-bit memory area).

MFC after: 1 week
Relnotes: yes
include/Makefile
sys/dev/acpica/acpi_hpet.c