diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2010-11-19 18:01:01 -0600 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2010-11-19 18:01:01 -0600 |
commit | 34a8e37c1319dc19c10d239834030793733dc475 (patch) | |
tree | 7cb543ca445438e2ddcb7d83625758b0a191ed7f /src | |
parent | 5c6f4a0f17f1f74bf913ce49f14517084949b8ed (diff) | |
download | gem5-34a8e37c1319dc19c10d239834030793733dc475.tar.xz |
SE: Fix simulating more than 4GB of RAM in SE mode
This change removes some dead code in PhysicalMemory, uses a 64 bit type
for the page pointer in System (instead of 32 bit) and cleans up some style.
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/physical.cc | 13 | ||||
-rw-r--r-- | src/mem/physical.hh | 2 | ||||
-rw-r--r-- | src/sim/system.cc | 16 | ||||
-rw-r--r-- | src/sim/system.hh | 6 |
4 files changed, 13 insertions, 24 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc index c24300cad..937fb80a2 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -68,8 +68,7 @@ using namespace std; using namespace TheISA; PhysicalMemory::PhysicalMemory(const Params *p) - : MemObject(p), pmemAddr(NULL), pagePtr(0), - lat(p->latency), lat_var(p->latency_var), + : MemObject(p), pmemAddr(NULL), lat(p->latency), lat_var(p->latency_var), _size(params()->range.size()), _start(params()->range.start) { if (size() % TheISA::PageBytes != 0) @@ -124,16 +123,6 @@ PhysicalMemory::~PhysicalMemory() munmap((char*)pmemAddr, size()); } -Addr -PhysicalMemory::new_page() -{ - Addr return_addr = pagePtr << LogVMPageSize; - return_addr += start(); - - ++pagePtr; - return return_addr; -} - unsigned PhysicalMemory::deviceBlockSize() const { diff --git a/src/mem/physical.hh b/src/mem/physical.hh index a19db4d9d..cd6d809e2 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -148,7 +148,6 @@ class PhysicalMemory : public MemObject } uint8_t *pmemAddr; - int pagePtr; Tick lat; Tick lat_var; std::vector<MemoryPort*> ports; @@ -157,7 +156,6 @@ class PhysicalMemory : public MemObject uint64_t _size; uint64_t _start; public: - Addr new_page(); uint64_t size() { return _size; } uint64_t start() { return _start; } diff --git a/src/sim/system.cc b/src/sim/system.cc index 58e765b89..d590adc91 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -67,8 +67,8 @@ System::System(Params *p) init_param(p->init_param), loadAddrMask(p->load_addr_mask), #else - page_ptr(0), - next_PID(0), + pagePtr(0), + nextPID(0), #endif memoryMode(p->mem_mode), _params(p) { @@ -255,8 +255,8 @@ System::replaceThreadContext(ThreadContext *tc, int context_id) Addr System::new_page() { - Addr return_addr = page_ptr << LogVMPageSize; - ++page_ptr; + Addr return_addr = pagePtr << LogVMPageSize; + ++pagePtr; if (return_addr >= physmem->size()) fatal("Out of memory, please increase size of physical memory."); return return_addr; @@ -271,7 +271,7 @@ System::memSize() Addr System::freeMemSize() { - return physmem->size() - (page_ptr << LogVMPageSize); + return physmem->size() - (pagePtr << LogVMPageSize); } #endif @@ -282,7 +282,8 @@ System::serialize(ostream &os) #if FULL_SYSTEM kernelSymtab->serialize("kernel_symtab", os); #else // !FULL_SYSTEM - SERIALIZE_SCALAR(page_ptr); + SERIALIZE_SCALAR(pagePtr); + SERIALIZE_SCALAR(nextPID); #endif } @@ -293,7 +294,8 @@ System::unserialize(Checkpoint *cp, const string §ion) #if FULL_SYSTEM kernelSymtab->unserialize("kernel_symtab", cp, section); #else // !FULL_SYSTEM - UNSERIALIZE_SCALAR(page_ptr); + UNSERIALIZE_SCALAR(pagePtr); + UNSERIALIZE_SCALAR(nextPID); #endif } diff --git a/src/sim/system.hh b/src/sim/system.hh index 452446623..cdf7d3d7e 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -137,15 +137,15 @@ class System : public SimObject #else - int page_ptr; + Addr pagePtr; protected: - uint64_t next_PID; + uint64_t nextPID; public: uint64_t allocatePID() { - return next_PID++; + return nextPID++; } /** Amount of physical memory that is still free */ |