diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2003-11-02 19:38:22 -0500 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2003-11-02 19:38:22 -0500 |
commit | 34620649de5ff2b8cd33dac46fed8a1d07971587 (patch) | |
tree | 23875ae10a916243bdbf891100e9380d51f10ec9 /cpu/intr_control.cc | |
parent | 667cbb6690b1f4af68ab7dad8caed8cdf107a090 (diff) | |
download | gem5-34620649de5ff2b8cd33dac46fed8a1d07971587.tar.xz |
General fixes for Sampling CPU in full system mode, and serialization of sampling CPU
cpu/intr_control.cc:
Fix the reference to the cpu, to look up which cpu is being used
In sampling mode can't use an absolute pointer to the cpu, use the
exeContexts vector
cpu/intr_control.hh:
Add two new functions to simplify MP interrupts, fix it for sampling CPU model
--HG--
extra : convert_revision : a69cdbb81e6aefa3fd5385416713c689300bbea8
Diffstat (limited to 'cpu/intr_control.cc')
-rw-r--r-- | cpu/intr_control.cc | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/cpu/intr_control.cc b/cpu/intr_control.cc index 037b00ef4..c71a36b6f 100644 --- a/cpu/intr_control.cc +++ b/cpu/intr_control.cc @@ -40,6 +40,42 @@ IntrControl::IntrControl(const string &name, BaseCPU *c) : SimObject(name), cpu(c) {} +/* @todo + *Fix the cpu sim object parameter to be a system pointer + *instead, to avoid some extra dereferencing + */ +void +IntrControl::post(int int_num, int index) +{ + std::vector<ExecContext *> &xcvec = cpu->system->execContexts; + BaseCPU *temp = xcvec[0]->cpu; + temp->post_interrupt(int_num, index); +} + +void +IntrControl::post(int cpu_id, int int_num, int index) +{ + std::vector<ExecContext *> &xcvec = cpu->system->execContexts; + BaseCPU *temp = xcvec[cpu_id]->cpu; + temp->post_interrupt(int_num, index); +} + +void +IntrControl::clear(int int_num, int index) +{ + std::vector<ExecContext *> &xcvec = cpu->system->execContexts; + BaseCPU *temp = xcvec[0]->cpu; + temp->clear_interrupt(int_num, index); +} + +void +IntrControl::clear(int cpu_id, int int_num, int index) +{ + std::vector<ExecContext *> &xcvec = cpu->system->execContexts; + BaseCPU *temp = xcvec[cpu_id]->cpu; + temp->clear_interrupt(int_num, index); +} + BEGIN_DECLARE_SIM_OBJECT_PARAMS(IntrControl) SimObjectParam<BaseCPU *> cpu; @@ -48,7 +84,7 @@ END_DECLARE_SIM_OBJECT_PARAMS(IntrControl) BEGIN_INIT_SIM_OBJECT_PARAMS(IntrControl) - INIT_PARAM(cpu, "the processor") + INIT_PARAM(cpu, "the cpu") END_INIT_SIM_OBJECT_PARAMS(IntrControl) |