summaryrefslogtreecommitdiff
path: root/src/dev/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/dev/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/dev/alpha')
-rw-r--r--src/dev/alpha/backdoor.cc7
-rw-r--r--src/dev/alpha/tsunami.cc22
-rw-r--r--src/dev/alpha/tsunami.hh8
3 files changed, 21 insertions, 16 deletions
diff --git a/src/dev/alpha/backdoor.cc b/src/dev/alpha/backdoor.cc
index 4d9d046de..1c5bb5f54 100644
--- a/src/dev/alpha/backdoor.cc
+++ b/src/dev/alpha/backdoor.cc
@@ -50,6 +50,9 @@
#include "cpu/thread_context.hh"
#include "debug/AlphaBackdoor.hh"
#include "dev/alpha/backdoor.hh"
+#include "dev/alpha/tsunami.hh"
+#include "dev/alpha/tsunami_cchip.hh"
+#include "dev/alpha/tsunami_io.hh"
#include "dev/platform.hh"
#include "dev/simple_disk.hh"
#include "dev/terminal.hh"
@@ -99,7 +102,9 @@ AlphaBackdoor::startup()
alphaAccess->entryPoint = system->getKernelEntry();
alphaAccess->mem_size = system->physmem->size();
alphaAccess->cpuClock = cpu->frequency() / 1000000; // In MHz
- alphaAccess->intrClockFrequency = params()->platform->intrFrequency();
+ Tsunami *tsunami = dynamic_cast<Tsunami *>(params()->platform);
+ assert(tsunami);
+ alphaAccess->intrClockFrequency = tsunami->io->frequency();
#endif
}
diff --git a/src/dev/alpha/tsunami.cc b/src/dev/alpha/tsunami.cc
index 16e2bfb28..65154c7d8 100644
--- a/src/dev/alpha/tsunami.cc
+++ b/src/dev/alpha/tsunami.cc
@@ -36,6 +36,12 @@
#include <string>
#include <vector>
+#include "config/full_system.hh"
+
+#if FULL_SYSTEM //XXX AlphaSystem doesn't build in SE mode yet.
+#include "arch/alpha/system.hh"
+#endif
+
#include "config/the_isa.hh"
#include "cpu/intr_control.hh"
#include "dev/alpha/tsunami.hh"
@@ -43,7 +49,6 @@
#include "dev/alpha/tsunami_io.hh"
#include "dev/alpha/tsunami_pchip.hh"
#include "dev/terminal.hh"
-#include "sim/system.hh"
using namespace std;
//Should this be AlphaISA?
@@ -52,19 +57,18 @@ using namespace TheISA;
Tsunami::Tsunami(const Params *p)
: Platform(p), system(p->system)
{
-#if FULL_SYSTEM //XXX No platform pointer in SE mode.
- // set the back pointer from the system to myself
- system->platform = this;
-#endif
-
for (int i = 0; i < Tsunami::Max_CPUs; i++)
intr_sum_type[i] = 0;
}
-Tick
-Tsunami::intrFrequency()
+void
+Tsunami::init()
{
- return io->frequency();
+#if FULL_SYSTEM //XXX AlphaSystem doesn't build in SE mode yet.
+ AlphaSystem *alphaSystem = dynamic_cast<AlphaSystem *>(system);
+ assert(alphaSystem);
+ alphaSystem->setIntrFreq(io->frequency());
+#endif
}
void
diff --git a/src/dev/alpha/tsunami.hh b/src/dev/alpha/tsunami.hh
index 64aafe533..9380864b0 100644
--- a/src/dev/alpha/tsunami.hh
+++ b/src/dev/alpha/tsunami.hh
@@ -80,17 +80,13 @@ class Tsunami : public Platform
int intr_sum_type[Tsunami::Max_CPUs];
int ipi_pending[Tsunami::Max_CPUs];
+ void init();
+
public:
typedef TsunamiParams Params;
Tsunami(const Params *p);
/**
- * Return the interrupting frequency to AlphaAccess
- * @return frequency of RTC interrupts
- */
- virtual Tick intrFrequency();
-
- /**
* Cause the cpu to post a serial interrupt to the CPU.
*/
virtual void postConsoleInt();