diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2012-03-09 09:59:26 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2012-03-09 09:59:26 -0500 |
commit | 3ce2d0fad04201b168dd9847a5120c80408f6498 (patch) | |
tree | 76c86f659e55295c3b9d85b3d424bf8fa3b35765 /src/arch/sparc | |
parent | ec1ef24895de75e8408398492ee8190866650bb5 (diff) | |
download | gem5-3ce2d0fad04201b168dd9847a5120c80408f6498.tar.xz |
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.
Diffstat (limited to 'src/arch/sparc')
-rw-r--r-- | src/arch/sparc/system.cc | 54 |
1 files changed, 27 insertions, 27 deletions
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. |