summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-10-14 16:53:52 -0400
committerNathan Binkert <binkertn@umich.edu>2003-10-14 16:53:52 -0400
commit638a07d15a149b48c854b58e2b3f4df097aa5e2e (patch)
tree82ac6aa2e2df719eeb2c8b6d319c4c7956bbc6b1 /cpu
parent2ac3dc5aa184da9fa08a304c67d646197ed9a7c5 (diff)
parent4759c203c774ef42a2a35832e220a95cffb5fa7b (diff)
downloadgem5-638a07d15a149b48c854b58e2b3f4df097aa5e2e.tar.xz
Merge
cpu/pc_event.cc: SCCS merged --HG-- extra : convert_revision : f7046f2bf6053be9b00150390fabe3d4f82b0981
Diffstat (limited to 'cpu')
-rw-r--r--cpu/exec_context.hh4
-rw-r--r--cpu/pc_event.cc83
-rw-r--r--cpu/pc_event.hh57
-rw-r--r--cpu/simple_cpu/simple_cpu.cc2
4 files changed, 13 insertions, 133 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index 5c1db6297..6964b35b8 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -245,8 +245,8 @@ class ExecContext
// stores (WH64?)
// Unsuccesful Store Conditionals would have returned above,
// and wouldn't fall through
- for(int i = 0; i < system->num_cpus; i++){
- cregs = &system->xc_array[i]->regs.miscRegs;
+ for(int i = 0; i < system->xcvec.size(); i++){
+ cregs = &system->xcvec[i]->regs.miscRegs;
if((cregs->lock_addr & ~0xf) == (req->paddr & ~0xf)) {
cregs->lock_flag = false;
}
diff --git a/cpu/pc_event.cc b/cpu/pc_event.cc
index 4a037663c..4ee93e864 100644
--- a/cpu/pc_event.cc
+++ b/cpu/pc_event.cc
@@ -37,16 +37,6 @@
#include "base/trace.hh"
#include "sim/universe.hh"
-#ifdef FULL_SYSTEM
-#include "targetarch/arguments.hh"
-#include "targetarch/pmap.h"
-#include "kern/tru64/kernel.hh"
-#include "mem/functional_mem/memory_control.hh"
-#include "sim/system.hh"
-#include "cpu/base_cpu.hh"
-#include "cpu/full_cpu/bpred.hh"
-#endif
-
using namespace std;
PCEventQueue::PCEventQueue()
@@ -85,7 +75,7 @@ PCEventQueue::schedule(PCEvent *event)
}
bool
-PCEventQueue::service(ExecContext *xc)
+PCEventQueue::doService(ExecContext *xc)
{
Addr pc = xc->regs.pc;
int serviced = 0;
@@ -125,77 +115,6 @@ PCEventQueue::equal_range(Addr pc)
return std::equal_range(pc_map.begin(), pc_map.end(), pc, MapCompare());
}
-#ifdef FULL_SYSTEM
-void
-SkipFuncEvent::process(ExecContext *xc)
-{
- Addr newpc = xc->regs.intRegFile[ReturnAddressReg];
-
- DPRINTF(PCEvent, "skipping %s: pc=%x, newpc=%x\n", description,
- xc->regs.pc, newpc);
-
- xc->regs.pc = newpc;
- xc->regs.npc = xc->regs.pc + sizeof(MachInst);
-
- BranchPred *bp = xc->cpu->getBranchPred();
- if (bp != NULL) {
- bp->popRAS(xc->thread_num);
- }
-}
-
-void
-BadAddrEvent::process(ExecContext *xc)
-{
- // The following gross hack is the equivalent function to the
- // annotation for vmunix::badaddr in:
- // simos/simulation/apps/tcl/osf/tlaser.tcl
-
- uint64_t a0 = xc->regs.intRegFile[ArgumentReg0];
-
- if (a0 < ALPHA_K0SEG_BASE || a0 >= ALPHA_K1SEG_BASE ||
- xc->memCtrl->badaddr(ALPHA_K0SEG_TO_PHYS(a0) & PA_IMPL_MASK)) {
-
- DPRINTF(BADADDR, "badaddr arg=%#x bad\n", a0);
- xc->regs.intRegFile[ReturnValueReg] = 0x1;
- SkipFuncEvent::process(xc);
- }
- else
- DPRINTF(BADADDR, "badaddr arg=%#x good\n", a0);
-}
-
-void
-PrintfEvent::process(ExecContext *xc)
-{
- if (DTRACE(Printf)) {
- DebugOut() << curTick << ": " << xc->cpu->name() << ": ";
-
- AlphaArguments args(xc);
- Kernel::Printf(args);
- }
-}
-
-void
-DebugPrintfEvent::process(ExecContext *xc)
-{
- if (DTRACE(DebugPrintf)) {
- if (!raw)
- DebugOut() << curTick << ": " << xc->cpu->name() << ": ";
-
- AlphaArguments args(xc);
- Kernel::Printf(args);
- }
-}
-
-void
-DumpMbufEvent::process(ExecContext *xc)
-{
- if (DTRACE(DebugPrintf)) {
- AlphaArguments args(xc);
- Kernel::DumpMbuf(args);
- }
-}
-#endif
-
BreakPCEvent::BreakPCEvent(PCEventQueue *q, const std::string &desc, bool del)
: PCEvent(q, desc), remove(del)
{
diff --git a/cpu/pc_event.hh b/cpu/pc_event.hh
index 08c6fa59a..645138fdd 100644
--- a/cpu/pc_event.hh
+++ b/cpu/pc_event.hh
@@ -98,13 +98,21 @@ class PCEventQueue
protected:
map_t pc_map;
+ bool doService(ExecContext *xc);
+
public:
PCEventQueue();
~PCEventQueue();
bool remove(PCEvent *event);
bool schedule(PCEvent *event);
- bool service(ExecContext *xc);
+ bool service(ExecContext *xc)
+ {
+ if (pc_map.empty())
+ return false;
+
+ return doService(xc);
+ }
range_t equal_range(Addr pc);
range_t equal_range(PCEvent *event) { return equal_range(event->pc()); }
@@ -155,52 +163,6 @@ PCEvent::schedule(PCEventQueue *q, Addr pc)
return schedule();
}
-
-#ifdef FULL_SYSTEM
-class SkipFuncEvent : public PCEvent
-{
- public:
- SkipFuncEvent(PCEventQueue *q, const std::string &desc)
- : PCEvent(q, desc) {}
- virtual void process(ExecContext *xc);
-};
-
-class BadAddrEvent : public SkipFuncEvent
-{
- public:
- BadAddrEvent(PCEventQueue *q, const std::string &desc)
- : SkipFuncEvent(q, desc) {}
- virtual void process(ExecContext *xc);
-};
-
-class PrintfEvent : public PCEvent
-{
- public:
- PrintfEvent(PCEventQueue *q, const std::string &desc)
- : PCEvent(q, desc) {}
- virtual void process(ExecContext *xc);
-};
-
-class DebugPrintfEvent : public PCEvent
-{
- private:
- bool raw;
-
- public:
- DebugPrintfEvent(PCEventQueue *q, const std::string &desc, bool r = false)
- : PCEvent(q, desc), raw(r) {}
- virtual void process(ExecContext *xc);
-};
-
-class DumpMbufEvent : public PCEvent
-{
- public:
- DumpMbufEvent(PCEventQueue *q, const std::string &desc)
- : PCEvent(q, desc) {}
- virtual void process(ExecContext *xc);
-};
-#endif
-
class BreakPCEvent : public PCEvent
{
protected:
@@ -211,5 +173,4 @@ class BreakPCEvent : public PCEvent
virtual void process(ExecContext *xc);
};
-
#endif // __PC_EVENT_HH__
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index 2bbd74efa..8da4b1641 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -150,7 +150,7 @@ SimpleCPU::SimpleCPU(const string &_name, Process *_process,
_status = Idle;
}
else {
- system->initBootContext(xc);
+ system->init(xc);
// Reset the system
//