qemu-e2k/target/mips/sysemu
Jiaxun Yang b263688d23 target/mips: Rework cp0_timer with clock API
Previous implementation of MIPS cp0_timer computes a
cp0_count_ns based on input clock. However rounding
error of cp0_count_ns can affect precision of cp0_timer.

Using clock API and a divider for cp0_timer, so we can
use clock_ns_to_ticks/clock_ns_to_ticks to avoid rounding
issue.

Also workaround the situation that in such handler flow:

count = read_c0_count()
write_c0_compare(count)

If timer had not progressed when compare was written, the
interrupt would trigger again.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230521110037.90049-1-jiaxun.yang@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-07-10 21:53:03 +02:00
..
addr.c mips: Remove support for trap and emulate KVM 2023-01-13 09:32:32 +01:00
cp0_timer.c target/mips: Rework cp0_timer with clock API 2023-07-10 21:53:03 +02:00
cp0.c target/mips: Move CP0 helpers to sysemu/cp0.c 2021-05-02 16:49:35 +02:00
machine.c
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
mips-qmp-cmds.c target/mips: Restrict 'qapi-commands-machine.h' to system emulation 2023-01-13 16:22:57 +01:00
physaddr.c target/mips: Replace [g_]assert(0) -> g_assert_not_reached() 2023-03-07 18:08:12 +01:00