diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-03-31 20:32:18 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-03-31 20:32:18 -0500 |
commit | adeb458b878d0768fd4de82bc1997512dc65e6d3 (patch) | |
tree | d7b27950803618125f7c2fcfa3353e4e40e0166c /base/loader | |
parent | 5c79eb04104e6e3dd2fd957c071fef3ceb47b722 (diff) | |
parent | 5936c79ba0f3fd29ef2bbf41fcaddc78fcd9c75c (diff) | |
download | gem5-adeb458b878d0768fd4de82bc1997512dc65e6d3.tar.xz |
Merge m5.eecs.umich.edu:/bk/newmem
into ewok.(none):/home/gblack/m5/newmem
--HG--
extra : convert_revision : 08ae5e999d9b313e3e40cb6d58863905b70ca781
Diffstat (limited to 'base/loader')
-rw-r--r-- | base/loader/object_file.cc | 22 | ||||
-rw-r--r-- | base/loader/object_file.hh | 8 |
2 files changed, 13 insertions, 17 deletions
diff --git a/base/loader/object_file.cc b/base/loader/object_file.cc index 7f46ae2fb..c6dfced1d 100644 --- a/base/loader/object_file.cc +++ b/base/loader/object_file.cc @@ -63,22 +63,16 @@ ObjectFile::~ObjectFile() bool -ObjectFile::loadSection(Section *sec, TranslatingPort *memPort, bool loadPhys) +ObjectFile::loadSection(Section *sec, Port *memPort, Addr addrMask) { if (sec->size != 0) { - Addr addr = sec->baseAddr; - if (loadPhys) { - // this is Alpha-specific... going to have to fix this - // for other architectures - addr &= (ULL(1) << 40) - 1; - } - + Addr addr = sec->baseAddr & addrMask; if (sec->fileImage) { - memPort->writeBlob(addr, sec->fileImage, sec->size, true); + memPort->writeBlob(addr, sec->fileImage, sec->size); } else { // no image: must be bss - memPort->memsetBlob(addr, 0, sec->size, true); + memPort->memsetBlob(addr, 0, sec->size); } } return true; @@ -86,11 +80,11 @@ ObjectFile::loadSection(Section *sec, TranslatingPort *memPort, bool loadPhys) bool -ObjectFile::loadSections(TranslatingPort *memPort, bool loadPhys) +ObjectFile::loadSections(Port *memPort, Addr addrMask) { - return (loadSection(&text, memPort, loadPhys) - && loadSection(&data, memPort, loadPhys) - && loadSection(&bss, memPort, loadPhys)); + return (loadSection(&text, memPort, addrMask) + && loadSection(&data, memPort, addrMask) + && loadSection(&bss, memPort, addrMask)); } diff --git a/base/loader/object_file.hh b/base/loader/object_file.hh index 309089728..b43989cb5 100644 --- a/base/loader/object_file.hh +++ b/base/loader/object_file.hh @@ -29,11 +29,12 @@ #ifndef __OBJECT_FILE_HH__ #define __OBJECT_FILE_HH__ +#include <limits> #include <string> #include "sim/host.hh" // for Addr -class TranslatingPort; +class Port; class SymbolTable; class ObjectFile @@ -72,7 +73,8 @@ class ObjectFile void close(); - virtual bool loadSections(TranslatingPort *memPort, bool loadPhys = false); + virtual bool loadSections(Port *memPort, Addr addrMask = + std::numeric_limits<Addr>::max()); virtual bool loadGlobalSymbols(SymbolTable *symtab) = 0; virtual bool loadLocalSymbols(SymbolTable *symtab) = 0; @@ -94,7 +96,7 @@ class ObjectFile Section data; Section bss; - bool loadSection(Section *sec, TranslatingPort *memPort, bool loadPhys); + bool loadSection(Section *sec, Port *memPort, Addr addrMask); void setGlobalPointer(Addr global_ptr) { globalPtr = global_ptr; } public: |