summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-11-08 10:46:41 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-11-08 10:46:41 -0500
commit11b931df6aad5a3063812647a577957ad9443b7b (patch)
tree4cf0741e6b6fa558b01b079447b0df4aed524150 /src
parente41197a3f8e93a1c67dddccc96a54e6f560386b2 (diff)
downloadgem5-11b931df6aad5a3063812647a577957ad9443b7b.tar.xz
Interrupts: Inline some code and remove duplication.
--HG-- extra : convert_revision : 0631c601f281bdd2a12ff0d0ae94576780115c2a
Diffstat (limited to 'src')
-rw-r--r--src/cpu/intr_control.cc27
-rw-r--r--src/cpu/intr_control.hh14
2 files changed, 19 insertions, 22 deletions
diff --git a/src/cpu/intr_control.cc b/src/cpu/intr_control.cc
index 018ae1886..c3a11ad91 100644
--- a/src/cpu/intr_control.cc
+++ b/src/cpu/intr_control.cc
@@ -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"
@@ -44,35 +45,21 @@ IntrControl::IntrControl(const Params *p)
{}
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 *
diff --git a/src/cpu/intr_control.hh b/src/cpu/intr_control.hh
index 746859fab..2a63cf608 100644
--- a/src/cpu/intr_control.hh
+++ b/src/cpu/intr_control.hh
@@ -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__