-/* $OpenBSD: if_mcx.c,v 1.106 2022/11/22 06:48:32 jmatthew Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.107 2023/06/06 01:40:04 dlg Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
return (slots);
}
-static uint64_t
-mcx_uptime(void)
-{
- struct timespec ts;
-
- nanouptime(&ts);
-
- return ((uint64_t)ts.tv_sec * 1000000000 + (uint64_t)ts.tv_nsec);
-}
-
static void
mcx_calibrate_first(struct mcx_softc *sc)
{
sc->sc_calibration_gen = 0;
s = splhigh(); /* crit_enter? */
- c->c_ubase = mcx_uptime();
+ c->c_ubase = nsecuptime();
c->c_tbase = mcx_timer(sc);
splx(s);
c->c_ratio = 0;
nc->c_timestamp = pc->c_tbase;
s = splhigh(); /* crit_enter? */
- nc->c_ubase = mcx_uptime();
+ nc->c_ubase = nsecuptime();
nc->c_tbase = mcx_timer(sc);
splx(s);