From 3ce2d0fad04201b168dd9847a5120c80408f6498 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 9 Mar 2012 09:59:26 -0500 Subject: System: Move code in initState() back into constructor whenever possible. The change to port proxies recently moved code out of the constructor into initState(). This is needed for code that loads data into memory, however for code that setups symbol tables, kernel based events, etc this is the wrong thing to do as that code is only called when a checkpoint isn't being restored from. --- src/arch/arm/linux/system.cc | 69 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'src/arch/arm/linux') diff --git a/src/arch/arm/linux/system.cc b/src/arch/arm/linux/system.cc index 4e18a265d..64bda4b4d 100644 --- a/src/arch/arm/linux/system.cc +++ b/src/arch/arm/linux/system.cc @@ -58,6 +58,40 @@ using namespace Linux; LinuxArmSystem::LinuxArmSystem(Params *p) : ArmSystem(p) { +#ifndef NDEBUG + kernelPanicEvent = addKernelFuncEvent("panic"); + if (!kernelPanicEvent) + panic("could not find kernel symbol \'panic\'"); +#endif + + // With ARM udelay() is #defined to __udelay + Addr addr = 0; + if (kernelSymtab->findAddress("__udelay", addr)) { + uDelaySkipEvent = new UDelayEvent(&pcEventQueue, "__udelay", + fixFuncEventAddr(addr), 1000, 0); + } else { + panic("couldn't find kernel symbol \'udelay\'"); + } + + // constant arguments to udelay() have some precomputation done ahead of + // time. Constant comes from code. + if (kernelSymtab->findAddress("__const_udelay", addr)) { + constUDelaySkipEvent = new UDelayEvent(&pcEventQueue, "__const_udelay", + fixFuncEventAddr(addr), 1000, 107374); + } else { + panic("couldn't find kernel symbol \'udelay\'"); + } + + secDataPtrAddr = 0; + secDataAddr = 0; + penReleaseAddr = 0; + kernelSymtab->findAddress("__secondary_data", secDataPtrAddr); + kernelSymtab->findAddress("secondary_data", secDataAddr); + kernelSymtab->findAddress("pen_release", penReleaseAddr); + + secDataPtrAddr &= ~ULL(0x7F); + secDataAddr &= ~ULL(0x7F); + penReleaseAddr &= ~ULL(0x7F); } bool @@ -116,41 +150,6 @@ LinuxArmSystem::initState() physProxy.writeBlob(params()->atags_addr, boot_data, size << 2); -#ifndef NDEBUG - kernelPanicEvent = addKernelFuncEvent("panic"); - if (!kernelPanicEvent) - panic("could not find kernel symbol \'panic\'"); -#endif - - // With ARM udelay() is #defined to __udelay - Addr addr = 0; - if (kernelSymtab->findAddress("__udelay", addr)) { - uDelaySkipEvent = new UDelayEvent(&pcEventQueue, "__udelay", - fixFuncEventAddr(addr), 1000, 0); - } else { - panic("couldn't find kernel symbol \'udelay\'"); - } - - // constant arguments to udelay() have some precomputation done ahead of - // time. Constant comes from code. - if (kernelSymtab->findAddress("__const_udelay", addr)) { - constUDelaySkipEvent = new UDelayEvent(&pcEventQueue, "__const_udelay", - fixFuncEventAddr(addr), 1000, 107374); - } else { - panic("couldn't find kernel symbol \'udelay\'"); - } - - secDataPtrAddr = 0; - secDataAddr = 0; - penReleaseAddr = 0; - kernelSymtab->findAddress("__secondary_data", secDataPtrAddr); - kernelSymtab->findAddress("secondary_data", secDataAddr); - kernelSymtab->findAddress("pen_release", penReleaseAddr); - - secDataPtrAddr &= ~ULL(0x7F); - secDataAddr &= ~ULL(0x7F); - penReleaseAddr &= ~ULL(0x7F); - for (int i = 0; i < threadContexts.size(); i++) { threadContexts[i]->setIntReg(0, 0); threadContexts[i]->setIntReg(1, params()->machine_type); -- cgit v1.2.3