vdso
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user