Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/52403 )

Change subject: dev-arm: Set default initial values in GenericTimer::CoreTimers.
......................................................................

dev-arm: Set default initial values in GenericTimer::CoreTimers.

The cntkctl and cnthctl registers were not initialized by the CoreTimers
constructor which upset valgrind when they were later used by
handleStream.

This change gives them and other simple variables default initial values
so that they will at least have deterministic junk in them if they
aren't sensibly initialized by something else.

Change-Id: Iaedbb2d957aeb428fd563be2e24ccb8d2cf57f26
---
M src/dev/arm/generic_timer.hh
1 file changed, 25 insertions(+), 8 deletions(-)



diff --git a/src/dev/arm/generic_timer.hh b/src/dev/arm/generic_timer.hh
index 9cccef6..cd3dc90 100644
--- a/src/dev/arm/generic_timer.hh
+++ b/src/dev/arm/generic_timer.hh
@@ -311,21 +311,21 @@
         GenericTimer &parent;

         /// System counter frequency as visible from this core
-        uint32_t cntfrq;
+        uint32_t cntfrq = 0;

         /// Kernel control register
-        ArmISA::CNTKCTL cntkctl;
+        ArmISA::CNTKCTL cntkctl = 0;

         /// Hypervisor control register
-        ArmISA::CNTHCTL cnthctl;
+        ArmISA::CNTHCTL cnthctl = 0;

         /// Thread (HW) context associated to this PE implementation
-        ThreadContext *threadContext;
+        ThreadContext *threadContext = nullptr;

-        ArmInterruptPin const *irqPhysS;
-        ArmInterruptPin const *irqPhysNS;
-        ArmInterruptPin const *irqVirt;
-        ArmInterruptPin const *irqHyp;
+        ArmInterruptPin const *irqPhysS = nullptr;
+        ArmInterruptPin const *irqPhysNS = nullptr;
+        ArmInterruptPin const *irqVirt = nullptr;
+        ArmInterruptPin const *irqHyp = nullptr;

         ArchTimerKvm physS;
         ArchTimerKvm physNS;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52403
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Iaedbb2d957aeb428fd563be2e24ccb8d2cf57f26
Gerrit-Change-Number: 52403
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to