[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/11] hw/openrisc: Initialize timer time at startup
From: |
Stafford Horne |
Subject: |
[PATCH v2 06/11] hw/openrisc: Initialize timer time at startup |
Date: |
Mon, 4 Jul 2022 06:28:18 +0900 |
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.
Initialize last_clk to the qemu clock on initialization.
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
hw/openrisc/cputimer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c
index 93268815d8..4dbba3a3d4 100644
--- a/hw/openrisc/cputimer.c
+++ b/hw/openrisc/cputimer.c
@@ -140,6 +140,7 @@ void cpu_openrisc_clock_init(OpenRISCCPU *cpu)
if (or1k_timer == NULL) {
or1k_timer = g_new0(OR1KTimerState, 1);
+ or1k_timer->last_clk = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
vmstate_register(NULL, 0, &vmstate_or1k_timer, or1k_timer);
}
}
--
2.36.1
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, (continued)
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Anup Patel, 2022/07/03
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Richard Henderson, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Laurent Vivier, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Richard Henderson, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Laurent Vivier, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Stafford Horne, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Jason A. Donenfeld, 2022/07/04
- Re: [PATCH v2 03/11] goldfish_rtc: Add endianness property, Stafford Horne, 2022/07/04
[PATCH v2 04/11] hw/openrisc: Add the OpenRISC virtual machine, Stafford Horne, 2022/07/03
[PATCH v2 05/11] hw/openrisc: Add PCI bus support to virt, Stafford Horne, 2022/07/03
[PATCH v2 06/11] hw/openrisc: Initialize timer time at startup,
Stafford Horne <=
[PATCH v2 07/11] target/openrisc: Add interrupted CPU to log, Stafford Horne, 2022/07/03
[PATCH v2 08/11] target/openrisc: Enable MTTCG, Stafford Horne, 2022/07/03
[PATCH v2 09/11] target/openrisc: Interrupt handling fixes, Stafford Horne, 2022/07/03