mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-16 05:13:40 +00:00
libc binuptime(): use the right function to get the most significant bit index
Reported and tested by: Jaroslaw Pelczar <jarek@jpelczar.com> PR: 261781 Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
14a15342bb
commit
a1f9326607
|
@ -83,9 +83,9 @@ binuptime(struct bintime *bt, struct vdso_timekeep *tk, bool abs)
|
|||
return (error);
|
||||
scale = th->th_scale;
|
||||
#ifdef _LP64
|
||||
scale_bits = ffsl(scale);
|
||||
scale_bits = flsl(scale);
|
||||
#else
|
||||
scale_bits = ffsll(scale);
|
||||
scale_bits = flsll(scale);
|
||||
#endif
|
||||
if (__predict_false(scale_bits + fls(delta) > 63)) {
|
||||
x = (scale >> 32) * delta;
|
||||
|
|
Loading…
Reference in a new issue