summary refs log tree commit diff stats
path: root/hw/core/clock.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-12-15 15:09:27 +0000
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-01-04 23:24:44 +0100
commit0ac1fb256742f665449c3dd02dd0ed7a5112cea1 (patch)
treedc9b23520a0cb7a7da9a30049b44a521859f1e33 /hw/core/clock.c
parent554d523785ef8681905ec13ad28a025ec0af40fe (diff)
downloadfocaccia-qemu-0ac1fb256742f665449c3dd02dd0ed7a5112cea1.tar.gz
focaccia-qemu-0ac1fb256742f665449c3dd02dd0ed7a5112cea1.zip
target/mips: Don't use clock_get_ns() in clock period calculation
Currently the MIPS code uses the old clock_get_ns() API to
calculate a time length in nanoseconds:
 cpu->cp0_count_rate * clock_get_ns(MIPS_CPU(cpu)->clock)

This relies on the clock having a period which is an exact number
of nanoseconds.

Switch to the new clock_ticks_to_ns() function, which does the
multiplication internally at a higher precision.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201215150929.30311-3-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/core/clock.c')
0 files changed, 0 insertions, 0 deletions