diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -153,6 +153,8 @@ }, }; +static uint64_t get_cntxct(bool); + static int arm_tmr_attach(device_t); static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, @@ -199,18 +201,9 @@ { uint64_t val; - if (physical) { - do { - val = get_el0(cntpct); - } - while (((val + 1) & 0x7FF) <= 1); - } - else { - do { - val = get_el0(cntvct); - } - while (((val + 1) & 0x7FF) <= 1); - } + do { + val = get_cntxct(physical); + } while (((val + 1) & 0x7FF) <= 1); return (val); }