#include "arch/alpha/faults.hh"
#include "arch/alpha/isa_traits.hh"
#include "base/compiler.hh"
+#include "base/trace.hh"
#include "cpu/thread_context.hh"
+#include "params/AlphaInterrupts.hh"
+#include "sim/sim_object.hh"
namespace AlphaISA {
-class Interrupts
+class Interrupts : public SimObject
{
private:
bool newInfoSet;
int newIpl;
int newSummary;
+ BaseCPU * cpu;
protected:
uint64_t interrupts[NumInterruptLevels];
uint64_t intstatus;
public:
- Interrupts()
+ typedef AlphaInterruptsParams Params;
+
+ const Params *
+ params() const
+ {
+ return dynamic_cast<const Params *>(_params);
+ }
+
+ Interrupts(Params * p) : SimObject(p), cpu(NULL)
{
memset(interrupts, 0, sizeof(interrupts));
intstatus = 0;
newInfoSet = false;
}
+ void
+ setCPU(BaseCPU * _cpu)
+ {
+ cpu = _cpu;
+ }
+
void
post(int int_num, int index)
{
}
void
- clear_all()
+ clearAll()
{
DPRINTF(Interrupt, "Interrupts all cleared\n");
}
bool
- check_interrupts(ThreadContext *tc) const
+ checkInterrupts(ThreadContext *tc) const
{
return (intstatus != 0) && !(tc->readPC() & 0x3);
}
Fault
getInterrupt(ThreadContext *tc)
{
- int ipl = 0;
- int summary = 0;
+ uint64_t ipl = 0;
+ uint64_t summary = 0;
if (tc->readMiscRegNoEffect(IPR_ASTRR))
panic("asynchronous traps not implemented\n");
if (tc->readMiscRegNoEffect(IPR_SIRR)) {
- for (int i = INTLEVEL_SOFTWARE_MIN;
+ for (uint64_t i = INTLEVEL_SOFTWARE_MIN;
i < INTLEVEL_SOFTWARE_MAX; i++) {
if (tc->readMiscRegNoEffect(IPR_SIRR) & (ULL(1) << i)) {
// See table 4-19 of 21164 hardware reference
uint64_t interrupts = intstatus;
if (interrupts) {
- for (int i = INTLEVEL_EXTERNAL_MIN;
+ for (uint64_t i = INTLEVEL_EXTERNAL_MIN;
i < INTLEVEL_EXTERNAL_MAX; i++) {
if (interrupts & (ULL(1) << i)) {
// See table 4-19 of 21164 hardware reference
tc->setMiscRegNoEffect(IPR_INTID, newIpl);
newInfoSet = false;
}
-
- uint64_t
- get_vec(int int_num)
- {
- panic("Shouldn't be called for Alpha\n");
- M5_DUMMY_RETURN;
- }
};
} // namespace AlphaISA