SE/FS: Record the system pointer all the time for the simple CPU.
authorGabe Black <gblack@eecs.umich.edu>
Fri, 10 Feb 2012 10:05:31 +0000 (02:05 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Fri, 10 Feb 2012 10:05:31 +0000 (02:05 -0800)
This pointer was only being stored in code that came from SE mode. The system
pointer is always meaningful and available, so it should always be stored.

src/cpu/simple/base.cc
src/cpu/simple_thread.cc
src/cpu/simple_thread.hh

index 945c40b7935fe73b27878fd3eea3d0cd09681069..02758ac043f46e5f4632332df0b0284f185252bf 100644 (file)
@@ -94,8 +94,8 @@ BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p)
     if (FullSystem)
         thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb);
     else
-        thread = new SimpleThread(this, /* thread_num */ 0, p->workload[0],
-                p->itb, p->dtb);
+        thread = new SimpleThread(this, /* thread_num */ 0, p->system,
+                p->workload[0], p->itb, p->dtb);
 
     thread->setStatus(ThreadContext::Halted);
 
index e193b127323e5dee9854c973e9761c4b1b055a9b..1781c28500a0d2b1067c1aa8669f8ced8002fa28 100644 (file)
 using namespace std;
 
 // constructor
-SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
-                           TheISA::TLB *_itb, TheISA::TLB *_dtb)
-    : ThreadState(_cpu, _thread_num, _process), itb(_itb), dtb(_dtb)
+SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
+                           Process *_process, TheISA::TLB *_itb,
+                           TheISA::TLB *_dtb)
+    : ThreadState(_cpu, _thread_num, _process), system(_sys), itb(_itb),
+      dtb(_dtb)
 {
     clearArchRegs();
     tc = new ProxyThreadContext<SimpleThread>(this);
index 39cb96c3abf97e17670f80133e417a8729aaf5d0..b6dc8f0475404f1fa8462b1d52fd7646820c8d3d 100644 (file)
@@ -137,8 +137,8 @@ class SimpleThread : public ThreadState
                  TheISA::TLB *_itb, TheISA::TLB *_dtb,
                  bool use_kernel_stats = true);
     // SE
-    SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
-                 TheISA::TLB *_itb, TheISA::TLB *_dtb);
+    SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
+                 Process *_process, TheISA::TLB *_itb, TheISA::TLB *_dtb);
 
     SimpleThread();