diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2011-10-16 05:06:40 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2011-10-16 05:06:40 -0700 |
commit | bcf664e5f922bf1f1cbdb4bed493a441f82df7f7 (patch) | |
tree | 601d76ca3dec31adf8aca23a5bf7e8bb25c0c6ab /src/mem/page_table.cc | |
parent | 6ba3ebae43bbc7267e7f013bed949cc3339f0308 (diff) | |
download | gem5-bcf664e5f922bf1f1cbdb4bed493a441f82df7f7.tar.xz |
SE/FS: Turn on the page table class in FS.
Diffstat (limited to 'src/mem/page_table.cc')
-rw-r--r-- | src/mem/page_table.cc | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc index a94d92480..a2d566d0c 100644 --- a/src/mem/page_table.cc +++ b/src/mem/page_table.cc @@ -52,9 +52,15 @@ using namespace std; using namespace TheISA; -PageTable::PageTable(Process *_process, Addr _pageSize) - : pageSize(_pageSize), offsetMask(mask(floorLog2(_pageSize))), - process(_process) +PageTable::PageTable( +#if !FULL_SYSTEM + Process *_process, +#endif + Addr _pageSize) + : pageSize(_pageSize), offsetMask(mask(floorLog2(_pageSize))) +#if !FULL_SYSTEM + , process(_process) +#endif { assert(isPowerOf2(pageSize)); pTableCache[0].vaddr = 0; @@ -83,9 +89,11 @@ PageTable::allocate(Addr vaddr, int64_t size) vaddr); } +#if !FULL_SYSTEM pTable[vaddr] = TheISA::TlbEntry(process->M5_pid, vaddr, process->system->new_page()); updateCache(vaddr, pTable[vaddr]); +#endif } } @@ -196,7 +204,9 @@ PageTable::serialize(std::ostream &os) PTableItr iter = pTable.begin(); PTableItr end = pTable.end(); while (iter != end) { +#if !FULL_SYSTEM os << "\n[" << csprintf("%s.Entry%d", process->name(), count) << "]\n"; +#endif paramOut(os, "vaddr", iter->first); iter->second.serialize(os); @@ -212,17 +222,20 @@ PageTable::unserialize(Checkpoint *cp, const std::string §ion) { int i = 0, count; paramIn(cp, section, "ptable.size", count); - Addr vaddr; - TheISA::TlbEntry *entry; pTable.clear(); - while(i < count) { + while (i < count) { +#if !FULL_SYSTEM + TheISA::TlbEntry *entry; + Addr vaddr; + paramIn(cp, csprintf("%s.Entry%d", process->name(), i), "vaddr", vaddr); entry = new TheISA::TlbEntry(); entry->unserialize(cp, csprintf("%s.Entry%d", process->name(), i)); pTable[vaddr] = *entry; ++i; +#endif } } |