From facb40f3ffce30cd9bc3b904eed5761d2d8b91c9 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 30 Oct 2011 00:33:02 -0700 Subject: SE/FS: Make getProcessPtr available in both modes, and get rid of FULL_SYSTEMs. --- src/cpu/checker/thread_context.hh | 3 +-- src/cpu/inorder/thread_context.cc | 4 ---- src/cpu/inorder/thread_context.hh | 3 +-- src/cpu/o3/thread_context.hh | 3 +-- src/cpu/o3/thread_context_impl.hh | 3 +-- src/cpu/ozone/cpu.hh | 3 +-- src/cpu/ozone/cpu_impl.hh | 3 +-- src/cpu/simple_thread.cc | 5 ++--- src/cpu/thread_context.hh | 6 ++---- src/cpu/thread_state.hh | 3 +-- 10 files changed, 11 insertions(+), 25 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh index 94ba561f0..8b741080b 100644 --- a/src/cpu/checker/thread_context.hh +++ b/src/cpu/checker/thread_context.hh @@ -96,9 +96,8 @@ class CheckerThreadContext : public ThreadContext TheISA::Kernel::Statistics *getKernelStats() { return actualTC->getKernelStats(); } -#else - Process *getProcessPtr() { return actualTC->getProcessPtr(); } #endif + Process *getProcessPtr() { return actualTC->getProcessPtr(); } TranslatingPort *getMemPort() { return actualTC->getMemPort(); } diff --git a/src/cpu/inorder/thread_context.cc b/src/cpu/inorder/thread_context.cc index f5e55627c..8fc6ac75f 100644 --- a/src/cpu/inorder/thread_context.cc +++ b/src/cpu/inorder/thread_context.cc @@ -85,11 +85,7 @@ InOrderThreadContext::takeOverFrom(ThreadContext *old_context) { // some things should already be set up assert(getSystemPtr() == old_context->getSystemPtr()); -#if !FULL_SYSTEM assert(getProcessPtr() == old_context->getProcessPtr()); -#endif - - // copy over functional state setStatus(old_context->status()); diff --git a/src/cpu/inorder/thread_context.hh b/src/cpu/inorder/thread_context.hh index 9b071ee5d..95338c05c 100644 --- a/src/cpu/inorder/thread_context.hh +++ b/src/cpu/inorder/thread_context.hh @@ -142,10 +142,9 @@ class InOrderThreadContext : public ThreadContext { return this->thread->quiesceEvent; } -#else +#endif /** Returns a pointer to this thread's process. */ Process *getProcessPtr() { return thread->getProcessPtr(); } -#endif TranslatingPort *getMemPort() { return thread->getMemPort(); } diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index 2688e75e1..145d6fd29 100755 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -98,10 +98,9 @@ class O3ThreadContext : public ThreadContext { return thread->kernelStats; } virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); } -#else +#endif /** Returns a pointer to this thread's process. */ virtual Process *getProcessPtr() { return thread->getProcessPtr(); } -#endif virtual TranslatingPort *getMemPort() { return thread->getMemPort(); } diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 515fa5a50..0952465d4 100755 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -70,9 +70,8 @@ O3ThreadContext::takeOverFrom(ThreadContext *old_context) // some things should already be set up #if FULL_SYSTEM assert(getSystemPtr() == old_context->getSystemPtr()); -#else - assert(getProcessPtr() == old_context->getProcessPtr()); #endif + assert(getProcessPtr() == old_context->getProcessPtr()); // copy over functional state setStatus(old_context->status()); diff --git a/src/cpu/ozone/cpu.hh b/src/cpu/ozone/cpu.hh index 4860dd271..70b46ec5f 100644 --- a/src/cpu/ozone/cpu.hh +++ b/src/cpu/ozone/cpu.hh @@ -123,9 +123,8 @@ class OzoneCPU : public BaseCPU TheISA::Kernel::Statistics *getKernelStats() { return thread->getKernelStats(); } -#else - Process *getProcessPtr() { return thread->getProcessPtr(); } #endif + Process *getProcessPtr() { return thread->getProcessPtr(); } TranslatingPort *getMemPort() { return thread->getMemPort(); } diff --git a/src/cpu/ozone/cpu_impl.hh b/src/cpu/ozone/cpu_impl.hh index bb6e96ecc..724bd99a4 100644 --- a/src/cpu/ozone/cpu_impl.hh +++ b/src/cpu/ozone/cpu_impl.hh @@ -671,9 +671,8 @@ OzoneCPU::OzoneTC::takeOverFrom(ThreadContext *old_context) // some things should already be set up #if FULL_SYSTEM assert(getSystemPtr() == old_context->getSystemPtr()); -#else - assert(getProcessPtr() == old_context->getProcessPtr()); #endif + assert(getProcessPtr() == old_context->getProcessPtr()); // copy over functional state setStatus(old_context->status()); diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc index 6b9f60402..53534a4f3 100644 --- a/src/cpu/simple_thread.cc +++ b/src/cpu/simple_thread.cc @@ -41,6 +41,7 @@ #include "cpu/thread_context.hh" #include "mem/vport.hh" #include "params/BaseCPU.hh" +#include "sim/process.hh" #if FULL_SYSTEM #include "arch/kernel_stats.hh" @@ -55,7 +56,6 @@ #include "sim/sim_exit.hh" #else #include "mem/translating_port.hh" -#include "sim/process.hh" #include "sim/system.hh" #endif @@ -123,9 +123,8 @@ SimpleThread::takeOverFrom(ThreadContext *oldContext) // some things should already be set up #if FULL_SYSTEM assert(system == oldContext->getSystemPtr()); -#else - assert(process == oldContext->getProcessPtr()); #endif + assert(process == oldContext->getProcessPtr()); copyState(oldContext); #if FULL_SYSTEM diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh index f43940fe3..e4e26d03c 100644 --- a/src/cpu/thread_context.hh +++ b/src/cpu/thread_context.hh @@ -129,9 +129,8 @@ class ThreadContext virtual TheISA::Kernel::Statistics *getKernelStats() = 0; virtual void connectMemPorts(ThreadContext *tc) = 0; -#else - virtual Process *getProcessPtr() = 0; #endif + virtual Process *getProcessPtr() = 0; virtual TranslatingPort *getMemPort() = 0; @@ -299,9 +298,8 @@ class ProxyThreadContext : public ThreadContext { return actualTC->getKernelStats(); } void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); } -#else - Process *getProcessPtr() { return actualTC->getProcessPtr(); } #endif + Process *getProcessPtr() { return actualTC->getProcessPtr(); } TranslatingPort *getMemPort() { return actualTC->getMemPort(); } diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh index 10b87f02c..bc16b4f98 100644 --- a/src/cpu/thread_state.hh +++ b/src/cpu/thread_state.hh @@ -101,9 +101,8 @@ struct ThreadState { void profileSample(); TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; } -#else - Process *getProcessPtr() { return process; } #endif + Process *getProcessPtr() { return process; } TranslatingPort *getMemPort(); -- cgit v1.2.3