qemu/target/mips
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
..
sysemu target/mips: Rework cp0_timer with clock API 2023-07-10 21:53:03 +02:00
tcg meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
cpu-defs.c.inc target/mips: Set correct CP0.Config[4, 5] values for M14K(c) 2023-03-08 00:37:48 +01:00
cpu-param.h target/mips: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
cpu-qom.h target/mips: Convert to 3-phase reset 2022-12-16 15:58:15 +00:00
cpu.c target/mips: Rework cp0_timer with clock API 2023-07-10 21:53:03 +02:00
cpu.h target/mips: Rework cp0_timer with clock API 2023-07-10 21:53:03 +02:00
fpu_helper.h target/mips: Set set_default_nan_mode with set_snan_bit_is_one 2021-05-16 07:13:51 -05:00
fpu.c target/mips: Optimize CPU/FPU regnames[] arrays 2021-05-02 16:49:34 +02:00
gdbstub.c gdbstub: move register helpers into standalone include 2023-03-07 20:44:08 +00:00
helper.h target/mips: Extract NEC Vr54xx helper definitions 2021-08-25 13:02:14 +02:00
internal.h mips: Remove support for trap and emulate KVM 2023-01-13 09:32:32 +01:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
kvm_mips.h hw/mips: Implement the kvm_type() hook in MachineClass 2020-06-27 19:35:39 +02:00
kvm.c mips: Remove support for trap and emulate KVM 2023-01-13 09:32:32 +01:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
mips-defs.h target/mips: introduce decodetree structure for Cavium Octeon extension 2022-07-12 22:30:09 +02:00
msa.c target/mips: Move msa_reset() to new source file 2021-05-02 16:49:34 +02:00