From f94ff9ace556d9aa1ac9d00b8b1dbc73e161d213 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 13 Oct 2003 17:24:27 -0400 Subject: Split up kernel.cc into separate files for dump_mbuf and printf cpu/exec_context.hh: dev/alpha_console.cc: sim/system.cc: sim/system.hh: Convert from fixed array to a vector arch/alpha/arguments.hh: now that CopyData and CopyString are in vtophys.hh, this include is not necessary arch/alpha/vtophys.hh: Include isa_traits.hh for Addr cpu/pc_event.cc: Temporarily get this working while we're changing things --HG-- extra : convert_revision : 9a7597b7bd5d050819766f8edf7a02f28447b9ca --- cpu/exec_context.hh | 4 ++-- cpu/pc_event.cc | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'cpu') 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 a275c2c41..7b72f5c08 100644 --- a/cpu/pc_event.cc +++ b/cpu/pc_event.cc @@ -40,7 +40,6 @@ #ifdef FULL_SYSTEM #include "targetarch/arguments.hh" #include "targetarch/pmap.h" -#include "kern/tru64/kernel.hh" #include "mem/functional_mem/memory_control.hh" #include "cpu/full_cpu/cpu.hh" #include "sim/system.hh" @@ -163,6 +162,9 @@ BadAddrEvent::process(ExecContext *xc) DPRINTF(BADADDR, "badaddr arg=%#x good\n", a0); } +void Printf(AlphaArguments args); +void DumpMbuf(AlphaArguments args); + void PrintfEvent::process(ExecContext *xc) { @@ -170,7 +172,7 @@ PrintfEvent::process(ExecContext *xc) DebugOut() << curTick << ": " << xc->cpu->name() << ": "; AlphaArguments args(xc); - Kernel::Printf(args); + Printf(args); } } @@ -182,7 +184,7 @@ DebugPrintfEvent::process(ExecContext *xc) DebugOut() << curTick << ": " << xc->cpu->name() << ": "; AlphaArguments args(xc); - Kernel::Printf(args); + Printf(args); } } @@ -191,7 +193,7 @@ DumpMbufEvent::process(ExecContext *xc) { if (DTRACE(DebugPrintf)) { AlphaArguments args(xc); - Kernel::DumpMbuf(args); + DumpMbuf(args); } } #endif -- cgit v1.2.3 From 481aaf03cf933c13c3d9bf294629c6740726025e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 13 Oct 2003 22:19:43 -0400 Subject: Small optimization cpu/pc_event.cc: cpu/pc_event.hh: Do a quick check to see if there is anything to service before the function is called --HG-- extra : convert_revision : 16e9b6284ece8b7a53ccf0ca200fab9ba780c50c --- cpu/pc_event.cc | 2 +- cpu/pc_event.hh | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'cpu') diff --git a/cpu/pc_event.cc b/cpu/pc_event.cc index 7b72f5c08..8c584a492 100644 --- a/cpu/pc_event.cc +++ b/cpu/pc_event.cc @@ -84,7 +84,7 @@ PCEventQueue::schedule(PCEvent *event) } bool -PCEventQueue::service(ExecContext *xc) +PCEventQueue::doService(ExecContext *xc) { Addr pc = xc->regs.pc; int serviced = 0; diff --git a/cpu/pc_event.hh b/cpu/pc_event.hh index 08c6fa59a..d452bc030 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()); } -- cgit v1.2.3 From 4759c203c774ef42a2a35832e220a95cffb5fa7b Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 14 Oct 2003 12:19:59 -0400 Subject: Remove all of the Tru64 specific stuff from the base System object into its own Tru64System object. Also remove the System builder stuff and create a Tru64System builder. This makes it much simpler to support more operating systems. arch/alpha/ev5.cc: Each system provides its own mechanism for doing a breakpoint. base/remote_gdb.hh: #include cpu/pc_event.cc: cpu/pc_event.hh: Separate out System specific PCEvents cpu/simple_cpu/simple_cpu.cc: each system provides its own init script kern/tru64/dump_mbuf.cc: kern/tru64/printf.cc: Stick this in a namespace --HG-- extra : convert_revision : 9f74527ed2ff8010431d9aff34357aaecc1fb3f6 --- cpu/pc_event.cc | 83 -------------------------------------------- cpu/pc_event.hh | 47 ------------------------- cpu/simple_cpu/simple_cpu.cc | 2 +- 3 files changed, 1 insertion(+), 131 deletions(-) (limited to 'cpu') diff --git a/cpu/pc_event.cc b/cpu/pc_event.cc index 8c584a492..4ee93e864 100644 --- a/cpu/pc_event.cc +++ b/cpu/pc_event.cc @@ -37,15 +37,6 @@ #include "base/trace.hh" #include "sim/universe.hh" -#ifdef FULL_SYSTEM -#include "targetarch/arguments.hh" -#include "targetarch/pmap.h" -#include "mem/functional_mem/memory_control.hh" -#include "cpu/full_cpu/cpu.hh" -#include "sim/system.hh" -#include "cpu/full_cpu/bpred.hh" -#endif - using namespace std; PCEventQueue::PCEventQueue() @@ -124,80 +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 Printf(AlphaArguments args); -void DumpMbuf(AlphaArguments args); - -void -PrintfEvent::process(ExecContext *xc) -{ - if (DTRACE(Printf)) { - DebugOut() << curTick << ": " << xc->cpu->name() << ": "; - - AlphaArguments args(xc); - Printf(args); - } -} - -void -DebugPrintfEvent::process(ExecContext *xc) -{ - if (DTRACE(DebugPrintf)) { - if (!raw) - DebugOut() << curTick << ": " << xc->cpu->name() << ": "; - - AlphaArguments args(xc); - Printf(args); - } -} - -void -DumpMbufEvent::process(ExecContext *xc) -{ - if (DTRACE(DebugPrintf)) { - AlphaArguments args(xc); - 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 d452bc030..645138fdd 100644 --- a/cpu/pc_event.hh +++ b/cpu/pc_event.hh @@ -163,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: @@ -219,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 // -- cgit v1.2.3