[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] system_clock_scale unset in hw/intc/armv7m_nvic.c

From: James Hanley
Subject: [Qemu-discuss] system_clock_scale unset in hw/intc/armv7m_nvic.c
Date: Fri, 13 Jan 2017 07:35:14 -0500

How should system_clock_scale be set in hw/intc/armv7m_nvic.c - there is no API for the global, and I've defaulted the global to SYSTICK_SCALE which seems to work, but is not obvious.  This was needed as this value was set to zero and the arm firmware was selecting the external clock source causing zero to be returned from systick_scale() and the interrupt to run continuously.

diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 06d8db6..c15841e 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -70,7 +70,7 @@ static const uint8_t nvic_id[] = {
 #define SYSTICK_CLKSOURCE (1 << 2)
 #define SYSTICK_COUNTFLAG (1 << 16)
-int system_clock_scale;
+int system_clock_scale = SYSTICK_SCALE;
 /* Conversion factor from qemu timer to SysTick frequencies.  */
 static inline int64_t systick_scale(nvic_state *s)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]