host-utils: Add muldiv64_round_up
commit47de6c4c287079744ceb96f606b3c0457addf380
authorNicholas Piggin <npiggin@gmail.com>
Tue, 8 Aug 2023 04:19:47 +0000 (8 14:19 +1000)
committerCédric Le Goater <clg@kaod.org>
Wed, 6 Sep 2023 09:19:33 +0000 (6 11:19 +0200)
treea0a66493d90bada49ac23e12774b24024e763d92
parent7798f5c576d898e7e10c4a2518f3f16411dedeb9
host-utils: Add muldiv64_round_up

This will be used for converting time intervals in different base units
to host units, for the purpose of scheduling timers to emulate target
timers. Timers typically must not fire before their requested expiry
time but may fire some time afterward, so rounding up is the right way
to implement these.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[ clg: renamed __muldiv64() to muldiv64_rounding() ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
include/qemu/host-utils.h