Hi,
I try to use the HPET timer from userspace (Ubuntu Linux 9.10, Kernel 2.6.31, x86 desktop system) to get an interrupt every 10ms. I started with example code
from Documentation/hpet.txt [1] and [2]. Unfortunately, both programs always fail when issuing the HPET_IE_ON ioctl.
Here is the output of the second program:
| $ sudo ./hpet_example 32 99
| hi_ireqfreq: 0x20 hi_flags: 0x0 hi_hpet: 0x0 hi_timer: 0x4
|
| ERROR: HPET_IE_ON failed
When looking at the kernel's debug messages, it seems that my system has eight
HPET channels, but only four of them get an IRQ assigned:
| $ dmesg | grep -i hpet
| ACPI: HPET 9feb0eb5 00038 (v01 PTLTD HPETTBL 00060000 LTP 00000001)
| ACPI: HPET id: 0x8086a701 base: 0xfed00000
| hpet clockevent registered
| HPET: 8 timers in total, 2 timers will be used for per-cpu timer
| hpet0: at MMIO 0xfed00000, IRQs 2, 8, 24, 25, 0, 0, 0, 0
| hpet0: 8 comparators, 64-bit 14.318180 MHz counter
| hpet: hpet2 irq 24 for MSI
| hpet: hpet3 irq 25 for MSI
| rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs
Now I'm a bit lost... I googled a lot to find other code examples or some general information about using HPET from Linux with little success. I came across a post on LKML [3] which may address my problem, but I'm not sure if the patch was already integrated by the main distros.
Can you give me any hints to work around the IRQ problem? Maybe there are other
possibilities to realise a 10ms timer on the x86 platform...
TIA,
Till.
[1] http://www.mjmwired.net/kernel/Documentation/hpet.txt
[2] http://blog.fpmurphy.com/2009/07/linux-hpet-support.html
[3] http://lkml.org/lkml/2008/1/12/128
--
real e-mail: wollenberg <at> web <dot> de
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:35:56 |
Calls: | 6,645 |
Calls today: | 5 |
Files: | 12,190 |
Messages: | 5,326,624 |