diff options
Diffstat (limited to 'kern/linux/linux_system.cc')
-rw-r--r-- | kern/linux/linux_system.cc | 108 |
1 files changed, 12 insertions, 96 deletions
diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 0e0f141b6..a0000fe33 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -45,17 +45,16 @@ extern SymbolTable *debugSymbolTable; -//un-comment this to see the state of call stack when it changes. -//#define SW_DEBUG - using namespace std; LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, MemoryController *_memCtrl, PhysicalMemory *_physmem, const string &kernel_path, const string &console_path, const string &palcode, const string &boot_osflags, - const string &bootloader_path, const bool _bin) - : System(_name, _init_param, _memCtrl, _physmem, _bin), bin(_bin) + const string &bootloader_path, const bool _bin, + const vector<string> &_binned_fns) + : System(_name, _init_param, _memCtrl, _physmem, _bin, _binned_fns), + bin(_bin), binned_fns(_binned_fns) { kernelSymtab = new SymbolTable; consoleSymtab = new SymbolTable; @@ -122,13 +121,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, consolePanicEvent = new BreakPCEvent(&pcEventQueue, "console panic"); #endif - badaddrEvent = new LinuxBadAddrEvent(&pcEventQueue, "badaddr"); - skipPowerStateEvent = new LinuxSkipFuncEvent(&pcEventQueue, - "tl_v48_capture_power_state"); - skipScavengeBootEvent = new LinuxSkipFuncEvent(&pcEventQueue, - "pmap_scavenge_boot"); - printfEvent = new LinuxPrintfEvent(&pcEventQueue, "printf"); - skipIdeDelay50msEvent = new LinuxSkipIdeDelay50msEvent(&pcEventQueue, "ide_delay_50ms"); @@ -137,13 +129,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, skipCacheProbeEvent = new LinuxSkipFuncEvent(&pcEventQueue, "determine_cpu_caches"); - /* debugPrintfEvent = new DebugPrintfEvent(&pcEventQueue, - "debug_printf", false); - debugPrintfrEvent = new DebugPrintfEvent(&pcEventQueue, - "debug_printfr", true); - dumpMbufEvent = new DumpMbufEvent(&pcEventQueue, "dump_mbuf"); -*/ - Addr addr = 0; if (kernelSymtab->findAddress("est_cycle_freq", addr)) { @@ -197,17 +182,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, consolePanicEvent->schedule(addr); #endif - if (kernelSymtab->findAddress("badaddr", addr)) - badaddrEvent->schedule(addr); - // else - //panic("could not find kernel symbol \'badaddr\'"); - - if (kernelSymtab->findAddress("tl_v48_capture_power_state", addr)) - skipPowerStateEvent->schedule(addr); - - if (kernelSymtab->findAddress("pmap_scavenge_boot", addr)) - skipScavengeBootEvent->schedule(addr); - if (kernelSymtab->findAddress("ide_delay_50ms", addr)) skipIdeDelay50msEvent->schedule(addr+8); @@ -216,20 +190,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, if (kernelSymtab->findAddress("determine_cpu_caches", addr)) skipCacheProbeEvent->schedule(addr+8); - -#if TRACING_ON - if (kernelSymtab->findAddress("printk", addr)) - printfEvent->schedule(addr); - - if (kernelSymtab->findAddress("m5printf", addr)) - debugPrintfEvent->schedule(addr); - - if (kernelSymtab->findAddress("m5printfr", addr)) - debugPrintfrEvent->schedule(addr); - - if (kernelSymtab->findAddress("m5_dump_mbuf", addr)) - dumpMbufEvent->schedule(addr); -#endif } LinuxSystem::~LinuxSystem() @@ -243,14 +203,9 @@ LinuxSystem::~LinuxSystem() delete kernelPanicEvent; delete consolePanicEvent; - delete badaddrEvent; - delete skipPowerStateEvent; - delete skipScavengeBootEvent; - delete printfEvent; - /*delete debugPrintfEvent; - delete debugPrintfrEvent; - delete dumpMbufEvent; -*/ + delete skipIdeDelay50msEvent; + delete skipDelayLoopEvent; + delete skipCacheProbeEvent; } void @@ -309,48 +264,6 @@ LinuxSystem::breakpoint() return remoteGDB[0]->trap(ALPHA_KENTRY_IF); } -void -LinuxSystem::populateMap(std::string callee, std::string caller) -{ - multimap<const string, string>::const_iterator i; - i = callerMap.insert(make_pair(callee, caller)); - assert(i != callerMap.end() && "should not fail populating callerMap"); -} - -bool -LinuxSystem::findCaller(std::string callee, std::string caller) const -{ - typedef multimap<const std::string, std::string>::const_iterator iter; - pair<iter, iter> range; - - range = callerMap.equal_range(callee); - for (iter i = range.first; i != range.second; ++i) { - if ((*i).second == caller) - return true; - } - return false; -} - -void -LinuxSystem::dumpState(ExecContext *xc) const -{ -#ifndef SW_DEBUG - return; -#endif - if (xc->swCtx) { - stack<fnCall *> copy(xc->swCtx->callStack); - if (copy.empty()) - return; - cprintf("xc->swCtx:\n"); - fnCall *top; - cprintf("|| call: %d\n",xc->swCtx->calls); - for (top = copy.top(); !copy.empty(); copy.pop() ) { - top = copy.top(); - cprintf("|| %13s : %s \n", top->name, top->myBin->name()); - } - } -} - BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) Param<bool> bin; @@ -363,6 +276,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) Param<string> pal_code; Param<string> boot_osflags; Param<string> bootloader_code; + VectorParam<string> binned_fns; END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) @@ -378,7 +292,8 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem) INIT_PARAM(pal_code, "file that contains palcode"), INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot", "a"), - INIT_PARAM(bootloader_code, "file that contains the bootloader") + INIT_PARAM(bootloader_code, "file that contains the bootloader"), + INIT_PARAM(binned_fns, "functions to be broken down and binned") END_INIT_SIM_OBJECT_PARAMS(LinuxSystem) @@ -387,7 +302,8 @@ CREATE_SIM_OBJECT(LinuxSystem) { LinuxSystem *sys = new LinuxSystem(getInstanceName(), init_param, mem_ctl, physmem, kernel_code, console_code, - pal_code, boot_osflags, bootloader_code, bin); + pal_code, boot_osflags, bootloader_code, + bin, binned_fns); return sys; } |