From e80ebc308f0e926d2965ddfb37e6d30e14c8c3da Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 10 Feb 2012 02:05:31 -0800 Subject: [PATCH] SE/FS: Record the system pointer all the time for the simple CPU. 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 | 4 ++-- src/cpu/simple_thread.cc | 8 +++++--- src/cpu/simple_thread.hh | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 945c40b79..02758ac04 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -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); diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc index e193b1273..1781c2850 100644 --- a/src/cpu/simple_thread.cc +++ b/src/cpu/simple_thread.cc @@ -59,9 +59,11 @@ 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(this); diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index 39cb96c3a..b6dc8f047 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -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(); -- 2.30.2