changeset 90299d921559 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=90299d921559
description:
        SPARC: Make SPARC's ISA's clear function initialize everything it 
should.

        Also make it not set some pointers to NULL potentially introducing a 
memory
        leak. That should be done in the constructor.

diffstat:

 src/arch/alpha/isa.hh |   2 ++
 src/arch/sparc/isa.cc |  18 +++++++++++++++---
 src/arch/sparc/isa.hh |   6 ++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diffs (64 lines):

diff -r 0e582f3dbc96 -r 90299d921559 src/arch/alpha/isa.hh
--- a/src/arch/alpha/isa.hh     Sun Oct 10 20:37:50 2010 -0700
+++ b/src/arch/alpha/isa.hh     Sun Oct 10 20:38:05 2010 -0700
@@ -31,6 +31,8 @@
 #ifndef __ARCH_ALPHA_ISA_HH__
 #define __ARCH_ALPHA_ISA_HH__
 
+#include <string.h>
+
 #include <string>
 #include <iostream>
 
diff -r 0e582f3dbc96 -r 90299d921559 src/arch/sparc/isa.cc
--- a/src/arch/sparc/isa.cc     Sun Oct 10 20:37:50 2010 -0700
+++ b/src/arch/sparc/isa.cc     Sun Oct 10 20:38:05 2010 -0700
@@ -99,6 +99,7 @@
     memset(tnpc, 0, sizeof(tnpc));
     memset(tstate, 0, sizeof(tstate));
     memset(tt, 0, sizeof(tt));
+    tba = 0;
     pstate = 0;
     tl = 0;
     pil = 0;
@@ -123,10 +124,21 @@
     lsuCtrlReg = 0;
 
     memset(scratchPad, 0, sizeof(scratchPad));
+
+    cpu_mondo_head = 0;
+    cpu_mondo_tail = 0;
+    dev_mondo_head = 0;
+    dev_mondo_tail = 0;
+    res_error_head = 0;
+    res_error_tail = 0;
+    nres_error_head = 0;
+    nres_error_tail = 0;
+
 #if FULL_SYSTEM
-    tickCompare = NULL;
-    sTickCompare = NULL;
-    hSTickCompare = NULL;
+    // If one of these events is active, it's not obvious to me how to get
+    // rid of it cleanly. For now we'll just assert that they're not.
+    if (tickCompare != NULL && sTickCompare != NULL && hSTickCompare != NULL)
+        panic("Tick comparison event active when clearing the ISA object.\n");
 #endif
 }
 
diff -r 0e582f3dbc96 -r 90299d921559 src/arch/sparc/isa.hh
--- a/src/arch/sparc/isa.hh     Sun Oct 10 20:37:50 2010 -0700
+++ b/src/arch/sparc/isa.hh     Sun Oct 10 20:38:05 2010 -0700
@@ -205,6 +205,12 @@
 
         ISA()
         {
+#if FULL_SYSTEM
+            tickCompare = NULL;
+            sTickCompare = NULL;
+            hSTickCompare = NULL;
+#endif
+
             clear();
         }
     };
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to