From 79d7565c5a96222e1bb66f615033fe4369d7a710 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 2 Aug 2003 01:55:03 +0000 Subject: [PATCH] Dump the HPET information block. What is the HPET I hear you ask? It is the High Precision Event Timer that is supposed to supplement and eventually replace the 8254 timer and the RTC periodic interrupts. Among other things, it is 64 bit (can be run in 32 bit mode for 32 bit cpus), and is suitable as a replacement for the ACPI timer on SMP systems (the specs are much better) and as a replacement for the ITC based synthetic clock for on ia64 systems. It seems IA64 and AMD64 systems tend to have this. It is likely to start showing up in i386 systems if it isn't already on some of them. --- usr.sbin/acpi/acpidump/acpi.c | 25 +++++++++++++++++++++++++ usr.sbin/acpi/acpidump/acpidump.h | 13 +++++++++++++ 2 files changed, 38 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 97df1725392b..18b830841dfa 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -295,6 +295,29 @@ acpi_handle_apic(struct ACPIsdt *sdp) printf(END_COMMENT); } +static void +acpi_handle_hpet(struct ACPIsdt *sdp) +{ + struct HPETbody *hpetp; + + acpi_print_sdt(sdp); + hpetp = (struct HPETbody *) sdp->body; + printf(BEGIN_COMMENT); + printf("\tHPET Number=%d\n", hpetp->hpet_number); + printf("\tADDR=0x%08x\n", hpetp->base_addr); + printf("\tHW Rev=0x%x\n", hpetp->block_hwrev); + printf("\tComparitors=%d\n", hpetp->block_comparitors); + printf("\tCounter Size=%d\n", hpetp->block_counter_size); + printf("\tLegacy IRQ routing capable={"); + if (hpetp->block_legacy_capable) + printf("TRUE}\n"); + else + printf("FALSE}\n"); + printf("\tPCI Vendor ID=0x%04x\n", hpetp->block_pcivendor); + printf("\tMinimul Tick=%d\n", hpetp->clock_tick); + printf(END_COMMENT); +} + static void init_namespace() { @@ -522,6 +545,8 @@ acpi_handle_rsdt(struct ACPIsdt *rsdp) acpi_handle_facp((struct FACPbody *) sdp->body); } else if (!memcmp(sdp->signature, "APIC", 4)) { acpi_handle_apic(sdp); + } else if (!memcmp(sdp->signature, "HPET", 4)) { + acpi_handle_hpet(sdp); } else { acpi_print_sdt(sdp); } diff --git a/usr.sbin/acpi/acpidump/acpidump.h b/usr.sbin/acpi/acpidump/acpidump.h index 579b38826f54..5863c9ca4be6 100644 --- a/usr.sbin/acpi/acpidump/acpidump.h +++ b/usr.sbin/acpi/acpidump/acpidump.h @@ -265,6 +265,19 @@ struct MADTbody { u_char body[1]; } __packed; +struct HPETbody { + u_int32_t block_hwrev:8, + block_comparitors:5, + block_counter_size:1, + :1, + block_legacy_capable:1, + block_pcivendor:16; + u_int32_t base_addr; + u_int64_t reserved1; + u_int8_t hpet_number; + u_int16_t clock_tick __packed; +} __packed; + void *acpi_map_physical(vm_offset_t, size_t); struct ACPIrsdp *acpi_find_rsd_ptr(void); int acpi_checksum(void *, size_t);