686de4059f
Signed-off-by: Chloe M. <chloe@mensia.org>
36 lines
778 B
C
36 lines
778 B
C
/*
|
|
* Copyright (c) 2026, Chloe M.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: HPET driver
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#include <machine/hpet.h>
|
|
#include <drivers/acpi/tables.h>
|
|
#include <drivers/acpi/acpi.h>
|
|
#include <ke/knot.h>
|
|
#include <ex/trace.h>
|
|
|
|
#define DTRACE(Fmt, ...) \
|
|
TRACE("[ HPET ]: " Fmt, ##__VA_ARGS__)
|
|
|
|
VOID
|
|
MdHpetInit(VOID)
|
|
{
|
|
ACPI_HPET *Hpet;
|
|
|
|
Hpet = AcpiQuery("HPET");
|
|
if (Hpet == NULL) {
|
|
KeKnot(
|
|
KNOT_UNBOUND_RSRC,
|
|
"could not detect HPET on this platform\n"
|
|
);
|
|
}
|
|
|
|
/* Some informational logging */
|
|
DTRACE("detected hpet with pci vendor id : %x\n", Hpet->PciVendorId);
|
|
DTRACE("counter size : %d\n", Hpet->CounterSize);
|
|
DTRACE("minimum tick : %d\n", Hpet->MinimumTick);
|
|
}
|