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 *cpu = tcvec[cpu_id]->getCpuPtr();
- cpu->postInterrupt(tcvec[cpu_id]->threadId(), int_num, index);
+ ThreadContext *tc = sys->getThreadContext(cpu_id);
+ tc->getCpuPtr()->postInterrupt(tc->threadId(), 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 *cpu = tcvec[cpu_id]->getCpuPtr();
- cpu->clearInterrupt(tcvec[cpu_id]->threadId(), int_num, index);
+ ThreadContext *tc = sys->getThreadContext(cpu_id);
+ tc->getCpuPtr()->clearInterrupt(tc->threadId(), int_num, index);
+}
+
+void
+IntrControl::clearAll(int cpu_id)
+{
+ DPRINTF(IntrControl, "Clear all pending interrupts for CPU %d\n", cpu_id);
+ ThreadContext *tc = sys->getThreadContext(cpu_id);
+ tc->getCpuPtr()->clearInterrupts(tc->threadId());
+}
+
+bool
+IntrControl::havePosted(int cpu_id) const
+{
+ DPRINTF(IntrControl, "Check pending interrupts for CPU %d\n", cpu_id);
+ ThreadContext *tc = sys->getThreadContext(cpu_id);
+ return tc->getCpuPtr()->checkInterrupts(tc);
}
IntrControl *
void clear(int cpu_id, int int_num, int index);
void post(int cpu_id, int int_num, int index);
+ void clearAll(int cpu_id);
+ bool havePosted(int cpu_id) const;
void
clear(int int_num, int index = 0)