This commit is contained in:
2026-08-13 17:22:36 +02:00
committed by Marvin Friedrich
parent 5ee30664c5
commit 40cea4dedd
48 changed files with 622 additions and 211 deletions
+2 -2
View File
@@ -26,12 +26,12 @@ struct hpet {
#define HPET_COUNTER (0xF0 / sizeof(uint64_t))
static void hpet_reset(struct clock* c) {
struct hpet* hpet = CONTAINER_OF(c, struct hpet, clock);
struct hpet* hpet = containerof(c, struct hpet, clock);
hpet->regs[HPET_COUNTER] = 0;
}
static uint64_t hpet_get_elapsed_ns(struct clock* c) {
struct hpet* hpet = CONTAINER_OF(c, struct hpet, clock);
struct hpet* hpet = containerof(c, struct hpet, clock);
uint64_t counter = hpet->regs[HPET_COUNTER];
return (counter * (uint64_t)hpet->period / 1'000'000);
}