#include <string>
#include <vector>
+#include "base/trace.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "cpu/intr_control.hh"
: SimObject(p), sys(p->sys)
{}
-void
-IntrControl::post(int int_num, int index)
-{
- std::vector<ThreadContext *> &tcvec = sys->threadContexts;
- BaseCPU *temp = tcvec[0]->getCpuPtr();
- temp->post_interrupt(int_num, index);
-}
-
void
IntrControl::post(int cpu_id, int int_num, int index)
{
+ DPRINTF(IntrControl, "post %d:%d (cpu %d)\n", int_num, index, cpu_id);
std::vector<ThreadContext *> &tcvec = sys->threadContexts;
- BaseCPU *temp = tcvec[cpu_id]->getCpuPtr();
- temp->post_interrupt(int_num, index);
-}
-
-void
-IntrControl::clear(int int_num, int index)
-{
- std::vector<ThreadContext *> &tcvec = sys->threadContexts;
- BaseCPU *temp = tcvec[0]->getCpuPtr();
- temp->clear_interrupt(int_num, index);
+ BaseCPU *cpu = tcvec[cpu_id]->getCpuPtr();
+ cpu->post_interrupt(int_num, index);
}
void
IntrControl::clear(int cpu_id, int int_num, int index)
{
+ DPRINTF(IntrControl, "clear %d:%d (cpu %d)\n", int_num, index, cpu_id);
std::vector<ThreadContext *> &tcvec = sys->threadContexts;
- BaseCPU *temp = tcvec[cpu_id]->getCpuPtr();
- temp->clear_interrupt(int_num, index);
+ BaseCPU *cpu = tcvec[cpu_id]->getCpuPtr();
+ cpu->clear_interrupt(int_num, index);
}
IntrControl *
typedef IntrControlParams Params;
IntrControl(const Params *p);
- void clear(int int_num, int index = 0);
- void post(int int_num, int index = 0);
void clear(int cpu_id, int int_num, int index);
void post(int cpu_id, int int_num, int index);
+
+ void
+ clear(int int_num, int index = 0)
+ {
+ clear(0, int_num, index);
+ }
+
+ void
+ post(int int_num, int index = 0)
+ {
+ post(0, int_num, index);
+ }
};
#endif // __INTR_CONTROL_HH__