summaryrefslogtreecommitdiffstats
path: root/docs/memory-hotplug.txt
diff options
context:
space:
mode:
authorPeter Maydell2020-12-15 16:09:26 +0100
committerPhilippe Mathieu-Daudé2021-01-04 23:24:44 +0100
commit554d523785ef8681905ec13ad28a025ec0af40fe (patch)
tree6fe5df390462c7057643ebcfcaec2624b5af2ef4 /docs/memory-hotplug.txt
parentvt82c686: Rename superio config related parts (diff)
downloadqemu-554d523785ef8681905ec13ad28a025ec0af40fe.tar.gz
qemu-554d523785ef8681905ec13ad28a025ec0af40fe.tar.xz
qemu-554d523785ef8681905ec13ad28a025ec0af40fe.zip
clock: Introduce clock_ticks_to_ns()
The clock_get_ns() API claims to return the period of a clock in nanoseconds. Unfortunately since it returns an integer and a clock's period is represented in units of 2^-32 nanoseconds, the result is often an approximation, and calculating a clock expiry deadline by multiplying clock_get_ns() by a number-of-ticks is unacceptably inaccurate. Introduce a new API clock_ticks_to_ns() which returns the number of nanoseconds it takes the clock to make a given number of ticks. This function can do the complete calculation internally and will thus give a more accurate result. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Luc Michel <luc@lmichel.fr> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201215150929.30311-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'docs/memory-hotplug.txt')
0 files changed, 0 insertions, 0 deletions