summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mem/physical.cc13
-rw-r--r--src/mem/physical.hh2
-rw-r--r--src/sim/system.cc16
-rw-r--r--src/sim/system.hh6
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 &section)
#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 */