#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"
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();
using namespace AlphaISA;
AlphaSystem::AlphaSystem(Params *p)
- : System(p)
+ : System(p), intrFreq(0)
{
consoleSymtab = new SymbolTable;
palSymtab = new SymbolTable;
#endif
protected:
+ Tick intrFreq;
+
const Params *params() const { return (const Params *)_params; }
/** Add a function-based event to PALcode. */
}
virtual Addr fixFuncEventAddr(Addr addr);
+
+ public:
+ void setIntrFreq(Tick freq) { intrFreq = freq; }
};
#endif // __ARCH_ALPHA_SYSTEM_HH__
void
LinuxMipsSystem::setDelayLoop(ThreadContext *tc)
{
- Addr addr = 0;
- if (kernelSymtab->findAddress("loops_per_jiffy", addr)) {
- Tick cpuFreq = tc->getCpuPtr()->frequency();
- Tick intrFreq = platform->intrFrequency();
- VirtualPort *vp;
-
- vp = tc->getVirtPort();
- vp->writeHtoG(addr, (uint32_t)((cpuFreq / intrFreq) * 0.9988));
- }
+ panic("setDelayLoop not implemented.\n");
}
#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"
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
}
#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"
#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?
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
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.
*/
RealView::RealView(const Params *p)
: Platform(p), system(p->system)
-{
-#if FULL_SYSTEM //XXX No platform pointer on the system object in SE mode.
- // set the back pointer from the system to myself
- system->platform = this;
-#endif
-}
-
-Tick
-RealView::intrFrequency()
-{
- panic("Need implementation\n");
- M5_DUMMY_RETURN
-}
+{}
void
RealView::postConsoleInt()
/** Give platform a pointer to interrupt controller */
void setGic(Gic *_gic) { gic = _gic; }
- /**
- * 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.
*/
Malta::Malta(const Params *p)
: Platform(p), system(p->system)
{
-#if FULL_SYSTEM //XXX No platform pointer on the system object in SE mode.
- // set the back pointer from the system to myself
- system->platform = this;
-#endif
-
for (int i = 0; i < Malta::Max_CPUs; i++)
intr_sum_type[i] = 0;
}
-Tick
-Malta::intrFrequency()
-{
- return io->frequency();
-}
-
void
Malta::postConsoleInt()
{
typedef MaltaParams Params;
Malta(const Params *p);
- /**
- * Return the interrupting frequency to MipsAccess
- * @return frequency of RTC interrupts
- */
- virtual Tick intrFrequency();
-
/**
* Cause the cpu to post a serial interrupt to the CPU.
*/
virtual ~Platform();
virtual void postConsoleInt() = 0;
virtual void clearConsoleInt() = 0;
- virtual Tick intrFrequency() = 0;
virtual void postPciInt(int line);
virtual void clearPciInt(int line);
virtual Addr pciToDma(Addr pciAddr) const;
T1000::T1000(const Params *p)
: Platform(p), system(p->system)
-{
-#if FULL_SYSTEM //XXX No platform pointer on system objects in SE mode.
- // set the back pointer from the system to myself
- system->platform = this;
-#endif
-}
-
-Tick
-T1000::intrFrequency()
-{
- panic("Need implementation\n");
- M5_DUMMY_RETURN
-}
+{}
void
T1000::postConsoleInt()
*/
T1000(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.
*/
: Platform(p), system(p->system)
{
southBridge = NULL;
- // set the back pointer from the system to myself
-#if FULL_SYSTEM //XXX No platform pointer in SE mode.
- system->platform = this;
-#endif
}
void
southBridge->pic2->maskAll();
}
-Tick
-Pc::intrFrequency()
-{
- panic("Need implementation for intrFrequency\n");
- M5_DUMMY_RETURN
-}
-
void
Pc::postConsoleInt()
{
Pc(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.
*/
bool isMemory(const Addr addr) const;
#if FULL_SYSTEM
- Platform *platform;
uint64_t init_param;
/** Port to physical memory used for writing object files into ram at