sys/cpu: Fix integer truncation in stall()
diff --git a/common/sys/cpu.h b/common/sys/cpu.h
index 8c4cf51e..e6099053 100644
--- a/common/sys/cpu.h
+++ b/common/sys/cpu.h
@@ -420,7 +420,7 @@ static inline void stall(uint64_t us) {
return;
}
#endif
- uint64_t ticks = tsc_freq / 1000000 * us;
+ uint64_t ticks = tsc_freq * us / 1000000;
uint64_t next_stop = rdtsc() + ticks;
while (rdtsc() < next_stop);
}
