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/sparc/system.cc | 54 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/arch/sparc') diff --git a/src/arch/sparc/system.cc b/src/arch/sparc/system.cc index ab5f7432e..9ce0a90de 100644 --- a/src/arch/sparc/system.cc +++ b/src/arch/sparc/system.cc @@ -48,13 +48,6 @@ SparcSystem::SparcSystem(Params *p) nvramSymtab = new SymbolTable; hypervisorDescSymtab = new SymbolTable; partitionDescSymtab = new SymbolTable; -} - -void -SparcSystem::initState() -{ - // Call the initialisation of the super class - System::initState(); /** * Load the boot code, and hypervisor into memory. @@ -91,26 +84,6 @@ SparcSystem::initState() fatal("Could not load partition description image %s", params()->partition_desc_bin); - - // Load reset binary into memory - reset->setTextBase(params()->reset_addr); - reset->loadSections(physProxy); - // Load the openboot binary - openboot->setTextBase(params()->openboot_addr); - openboot->loadSections(physProxy); - // Load the hypervisor binary - hypervisor->setTextBase(params()->hypervisor_addr); - hypervisor->loadSections(physProxy); - // Load the nvram image - nvram->setTextBase(params()->nvram_addr); - nvram->loadSections(physProxy); - // Load the hypervisor description image - hypervisor_desc->setTextBase(params()->hypervisor_desc_addr); - hypervisor_desc->loadSections(physProxy); - // Load the partition description image - partition_desc->setTextBase(params()->partition_desc_addr); - partition_desc->loadSections(physProxy); - // load symbols if (!reset->loadGlobalSymbols(resetSymtab)) panic("could not load reset symbols\n"); @@ -154,6 +127,33 @@ SparcSystem::initState() if (!partition_desc->loadLocalSymbols(debugSymbolTable)) panic("could not load partition description symbols\n"); +} + +void +SparcSystem::initState() +{ + // Call the initialisation of the super class + System::initState(); + + // Load reset binary into memory + reset->setTextBase(params()->reset_addr); + reset->loadSections(physProxy); + // Load the openboot binary + openboot->setTextBase(params()->openboot_addr); + openboot->loadSections(physProxy); + // Load the hypervisor binary + hypervisor->setTextBase(params()->hypervisor_addr); + hypervisor->loadSections(physProxy); + // Load the nvram image + nvram->setTextBase(params()->nvram_addr); + nvram->loadSections(physProxy); + // Load the hypervisor description image + hypervisor_desc->setTextBase(params()->hypervisor_desc_addr); + hypervisor_desc->loadSections(physProxy); + // Load the partition description image + partition_desc->setTextBase(params()->partition_desc_addr); + partition_desc->loadSections(physProxy); + // @todo any fixup code over writing data in binaries on setting break // events on functions should happen here. -- cgit v1.2.3