ref: 75c7e602be04158a3b3bf30feb3d9c13fc315788
parent: bfc41ef801c882b0454602b64607331aa359dea2
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 8 08:04:52 EST 2020
vmx: nanosec(): fix non-interruptable temporary, assign fasthz only once after xstart
--- a/sys/src/cmd/vmx/nanosec.c
+++ b/sys/src/cmd/vmx/nanosec.c
@@ -17,14 +17,15 @@
return nsec() - xstart;
if(fasthz == 0){- if((fasthz = _tos->cyclefreq) == 0){- fasthz = ~0ULL;
+ if(_tos->cyclefreq){+ cycles(&xstart);
+ fasthz = _tos->cyclefreq;
+ } else {xstart = nsec();
+ fasthz = ~0ULL;
fprint(2, "cyclefreq not available, falling back to nsec()\n");
fprint(2, "you might want to disable aux/timesync\n");
return 0;
- }else{- cycles(&xstart);
}
}
cycles(&x);
--
⑨