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)
munmap((char*)pmemAddr, size());
}
-Addr
-PhysicalMemory::new_page()
-{
- Addr return_addr = pagePtr << LogVMPageSize;
- return_addr += start();
-
- ++pagePtr;
- return return_addr;
-}
-
unsigned
PhysicalMemory::deviceBlockSize() const
{
}
uint8_t *pmemAddr;
- int pagePtr;
Tick lat;
Tick lat_var;
std::vector<MemoryPort*> ports;
uint64_t _size;
uint64_t _start;
public:
- Addr new_page();
uint64_t size() { return _size; }
uint64_t start() { return _start; }
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)
{
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;
Addr
System::freeMemSize()
{
- return physmem->size() - (page_ptr << LogVMPageSize);
+ return physmem->size() - (pagePtr << LogVMPageSize);
}
#endif
#if FULL_SYSTEM
kernelSymtab->serialize("kernel_symtab", os);
#else // !FULL_SYSTEM
- SERIALIZE_SCALAR(page_ptr);
+ SERIALIZE_SCALAR(pagePtr);
+ SERIALIZE_SCALAR(nextPID);
#endif
}
#if FULL_SYSTEM
kernelSymtab->unserialize("kernel_symtab", cp, section);
#else // !FULL_SYSTEM
- UNSERIALIZE_SCALAR(page_ptr);
+ UNSERIALIZE_SCALAR(pagePtr);
+ UNSERIALIZE_SCALAR(nextPID);
#endif
}