summaryrefslogtreecommitdiffstats
path: root/hw/timer/armv7m_systick.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/timer/armv7m_systick.c')
-rw-r--r--hw/timer/armv7m_systick.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/timer/armv7m_systick.c b/hw/timer/armv7m_systick.c
index 74c58bcf24..a8cec7eb56 100644
--- a/hw/timer/armv7m_systick.c
+++ b/hw/timer/armv7m_systick.c
@@ -202,6 +202,14 @@ static void systick_reset(DeviceState *dev)
{
SysTickState *s = SYSTICK(dev);
+ /*
+ * Forgetting to set system_clock_scale is always a board code
+ * bug. We can't check this earlier because for some boards
+ * (like stellaris) it is not yet configured at the point where
+ * the systick device is realized.
+ */
+ assert(system_clock_scale != 0);
+
s->control = 0;
s->reload = 0;
s->tick = 0;