From 43345bff6c4ee2fd5a35760776898eefa690329e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 8 Jul 2009 23:02:21 -0700 Subject: Registers: Move the PCs out of the ISAs and into the CPUs. --- src/arch/x86/regfile.cc | 37 ------------------------------------- src/arch/x86/regfile.hh | 20 +------------------- 2 files changed, 1 insertion(+), 56 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/regfile.cc b/src/arch/x86/regfile.cc index 54bc0999d..67ef0b128 100644 --- a/src/arch/x86/regfile.cc +++ b/src/arch/x86/regfile.cc @@ -85,48 +85,11 @@ * Authors: Gabe Black */ -#include "arch/x86/floatregs.hh" #include "arch/x86/miscregs.hh" #include "arch/x86/regfile.hh" #include "base/trace.hh" -#include "sim/serialize.hh" #include "cpu/thread_context.hh" -class Checkpoint; - -using namespace X86ISA; -using namespace std; - -//RegFile class methods -Addr RegFile::readPC() -{ - return rip; -} - -void RegFile::setPC(Addr val) -{ - rip = val; -} - -Addr RegFile::readNextPC() -{ - return nextRip; -} - -void RegFile::setNextPC(Addr val) -{ - nextRip = val; -} - -Addr RegFile::readNextNPC() -{ - //There's no way to know how big the -next- instruction will be. - return nextRip + 1; -} - -void RegFile::setNextNPC(Addr val) -{ } - void X86ISA::copyMiscRegs(ThreadContext *src, ThreadContext *dest) { diff --git a/src/arch/x86/regfile.hh b/src/arch/x86/regfile.hh index b832cbe28..6c0dc757e 100644 --- a/src/arch/x86/regfile.hh +++ b/src/arch/x86/regfile.hh @@ -58,14 +58,12 @@ #ifndef __ARCH_X86_REGFILE_HH__ #define __ARCH_X86_REGFILE_HH__ +#include #include #include "arch/x86/intregs.hh" #include "arch/x86/miscregs.hh" -#include "arch/x86/isa_traits.hh" #include "arch/x86/x86_traits.hh" -#include "arch/x86/types.hh" -#include "base/types.hh" class Checkpoint; class EventManager; @@ -88,28 +86,12 @@ namespace X86ISA class RegFile { - protected: - Addr rip; //Program Counter - Addr nextRip; //Next Program Counter - public: - Addr readPC(); - void setPC(Addr val); - - Addr readNextPC(); - void setNextPC(Addr val); - - Addr readNextNPC(); - void setNextNPC(Addr val); - - public: - void clear() {} void serialize(EventManager *em, std::ostream &os) {} - void unserialize(EventManager *em, Checkpoint *cp, const std::string §ion) {} -- cgit v1.2.3