2 * (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
10 #include <l4/drivers/hpet>
15 L4::Driver::Hpet::print_state() const
17 printf("HPET Information:\n");
18 printf("Rev-id: 0x%x\n", rev_id());
19 printf("Num timers: %d\n", num_tim_cap());
20 printf("Count size: %s\n", count_size_cap() ? "64bit" : "32bit");
21 printf("Legacy capable: %s\n", leg_rt_cap() ? "Yes" : "No");
22 printf("Legacy enabled: %s\n", leg_rt_cnf() ? "Yes" : "No");
23 printf("Vedor ID: 0x%x\n", vendor_id());
24 printf("Counter clock period: 0x%x / %u\n", counter_clk_period(),
25 counter_clk_period());
26 printf("Frequency (Hz): %lld\n", 1000000000000000ULL / counter_clk_period());
28 printf("Enabled: %s\n", enabled() ? "Yes" : "No");
30 printf("Main counter value: %lld\n", main_counter_val());
32 printf("Raw values: %16llx %16llx\n", cap_and_id(), conf());
35 for (unsigned i = 0; i < num_tim_cap(); ++i)
37 printf("HPET Timer-%d Information:\n", i);
38 timer(i)->print_state();
43 L4::Driver::Hpet::Timer::print_state() const
45 printf(" Int type: %s\n", is_int_type_level() ? "Level" : "Edge");
46 printf(" IRQ enabled: %s\n", is_int_enabled() ? "Yes" : "No");
47 printf(" Mode: %s\n", is_periodic() ? "Periodic" : "Non-periodic");
48 printf(" Periodic int capable: %s\n", periodic_int_capable() ? "Yes" : "No");
49 printf(" Can 64bit: %s\n", can_64bit() ? "Yes" : "No");
50 printf(" Forced to 32bit: %s\n", forced_32bit() ? "Yes" : "No");
51 printf(" Can FSB/MSI: %s\n", can_fsb() ? "Yes" : "No");
52 printf(" Does FSB/MSI: %s\n", is_fsb() ? "Yes" : "No");
53 printf(" IRQs available: %x\n", ints_avail());
54 printf(" IRQ set: %d\n", int_route_cnf());
55 printf(" Comparator value: %lld\n", comparator());
56 printf(" Raw values: %16llx %16llx\n", conf_and_cap(), comp());