Interrupts: Inline some code and remove duplication.

--HG--
extra : convert_revision : 0631c601f281bdd2a12ff0d0ae94576780115c2a
This commit is contained in:
Ali Saidi 2007-11-08 10:46:41 -05:00
parent e41197a3f8
commit 11b931df6a
2 changed files with 19 additions and 22 deletions

View file

@ -32,6 +32,7 @@
#include <string>
#include <vector>
#include "base/trace.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "cpu/intr_control.hh"
@ -43,36 +44,22 @@ IntrControl::IntrControl(const Params *p)
: 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 *

View file

@ -47,10 +47,20 @@ class IntrControl : public SimObject
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__