summaryrefslogtreecommitdiff
path: root/src/arch/alpha
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-09-30 00:29:07 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-09-30 00:29:07 -0700
commite2dbe59f5dd63ad7a84df701dfbd033320cb8bf9 (patch)
tree17b37b6883a251c9c3913b61e1ee6896ff407833 /src/arch/alpha
parent91dd72a99a784d4f895ae6e0ff36eed873aab9fe (diff)
downloadgem5-e2dbe59f5dd63ad7a84df701dfbd033320cb8bf9.tar.xz
SE/FS: Remove System::platform and Platform::intrFrequency.
In order for a system object to work in SE mode and FS mode, it has to either always require a platform object even in SE mode, or get rid of the requirement all together. Making SE mode carry around unnecessary/unused bits of FS seems less than ideal, so I decided to go with the second option. The platform pointer in the System class was used for exactly one purpose, a path for the Alpha Linux system object to get to the real time clock and read its frequency so that it could short cut the loops_per_jiffy calculation. There was also a copy and pasted implementation in MIPS, but since it was only there because it was there in Alpha I still count that as one use. This change reverses the mechanism that communicates the RTC frequency so that the Tsunami platform object pushes it up to the AlphaSystem object. This is slightly less specific than it could be because really only the AlphaLinuxSystem uses it. Because the intrFrequency function on the Platform class was no longer necessary (and unimplemented on anything but Alpha) it was eliminated. After this change, a platform will need to have a system, but a system won't have to have a platform.
Diffstat (limited to 'src/arch/alpha')
-rw-r--r--src/arch/alpha/linux/system.cc3
-rw-r--r--src/arch/alpha/system.cc2
-rw-r--r--src/arch/alpha/system.hh5
3 files changed, 7 insertions, 3 deletions
diff --git a/src/arch/alpha/linux/system.cc b/src/arch/alpha/linux/system.cc
index 6ca603a3b..e662ef9ce 100644
--- a/src/arch/alpha/linux/system.cc
+++ b/src/arch/alpha/linux/system.cc
@@ -49,7 +49,6 @@
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "debug/Thread.hh"
-#include "dev/platform.hh"
#include "kern/linux/events.hh"
#include "kern/linux/printk.hh"
#include "mem/physical.hh"
@@ -164,7 +163,7 @@ LinuxAlphaSystem::setDelayLoop(ThreadContext *tc)
Addr addr = 0;
if (kernelSymtab->findAddress("loops_per_jiffy", addr)) {
Tick cpuFreq = tc->getCpuPtr()->frequency();
- Tick intrFreq = platform->intrFrequency();
+ assert(intrFreq);
VirtualPort *vp;
vp = tc->getVirtPort();
diff --git a/src/arch/alpha/system.cc b/src/arch/alpha/system.cc
index 6a55ef8ae..f1afda76e 100644
--- a/src/arch/alpha/system.cc
+++ b/src/arch/alpha/system.cc
@@ -46,7 +46,7 @@
using namespace AlphaISA;
AlphaSystem::AlphaSystem(Params *p)
- : System(p)
+ : System(p), intrFreq(0)
{
consoleSymtab = new SymbolTable;
palSymtab = new SymbolTable;
diff --git a/src/arch/alpha/system.hh b/src/arch/alpha/system.hh
index da42ab263..a74aa206f 100644
--- a/src/arch/alpha/system.hh
+++ b/src/arch/alpha/system.hh
@@ -79,6 +79,8 @@ class AlphaSystem : public System
#endif
protected:
+ Tick intrFreq;
+
const Params *params() const { return (const Params *)_params; }
/** Add a function-based event to PALcode. */
@@ -98,6 +100,9 @@ class AlphaSystem : public System
}
virtual Addr fixFuncEventAddr(Addr addr);
+
+ public:
+ void setIntrFreq(Tick freq) { intrFreq = freq; }
};
#endif // __ARCH_ALPHA_SYSTEM_HH__