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);
|
return (error);
|
||||||
scale = th->th_scale;
|
scale = th->th_scale;
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
scale_bits = ffsl(scale);
|
scale_bits = flsl(scale);
|
||||||
#else
|
#else
|
||||||
scale_bits = ffsll(scale);
|
scale_bits = flsll(scale);
|
||||||
#endif
|
#endif
|
||||||
if (__predict_false(scale_bits + fls(delta) > 63)) {
|
if (__predict_false(scale_bits + fls(delta) > 63)) {
|
||||||
x = (scale >> 32) * delta;
|
x = (scale >> 32) * delta;
|
||||||
|
Loading…
Reference in New Issue
Block a user