]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/openrisc: Initialize timer time at startup
authorStafford Horne <shorne@gmail.com>
Tue, 14 Jun 2022 23:40:16 +0000 (08:40 +0900)
committerStafford Horne <shorne@gmail.com>
Sun, 4 Sep 2022 06:02:57 +0000 (07:02 +0100)
commit557e37071d4d4e6de577f5a4dfb012a6a733f319
tree48fa8f0a9eb89b08f59dd094a39b8e354544148e
parent40fef82c4e7ea723b52eb3d2a0c4a46189f1ad44
hw/openrisc: Initialize timer time at startup

The last_clk time was initialized at zero, this means when we calculate
the first delta we will calculate 0 vs current time which could cause
unnecessary hops.

This patch moves timer initialization to the cpu reset.  There are two
resets registered here:

 1. Per cpu timer mask (ttmr) reset.
 2. Global cpu timer (last_clk and ttcr) reset, attached to the first
    cpu only.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
hw/openrisc/cputimer.c