diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-10-25 19:04:44 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-10-25 19:04:44 -0700 |
commit | fddfa71658a35f91c249ce0b7b67984d979a4fb4 (patch) | |
tree | 2502a148cc3da2e0ebb53bdf9027a4b5a427423e /src/mem | |
parent | 0711f4f17a4b4ac61b07cbe742f0d193f919ea8f (diff) | |
download | gem5-fddfa71658a35f91c249ce0b7b67984d979a4fb4.tar.xz |
TLB: Fix serialization issues with the tlb entries and make the page table store the process, not the system.
--HG--
extra : convert_revision : 2421af11f62f60fb48faeee6bddadac2987df0e8
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/page_table.cc | 10 | ||||
-rw-r--r-- | src/mem/page_table.hh | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc index 8889879c3..6220305b8 100644 --- a/src/mem/page_table.cc +++ b/src/mem/page_table.cc @@ -43,15 +43,16 @@ #include "base/intmath.hh" #include "base/trace.hh" #include "mem/page_table.hh" +#include "sim/process.hh" #include "sim/sim_object.hh" #include "sim/system.hh" using namespace std; using namespace TheISA; -PageTable::PageTable(System *_system, Addr _pageSize) +PageTable::PageTable(Process *_process, Addr _pageSize) : pageSize(_pageSize), offsetMask(mask(floorLog2(_pageSize))), - system(_system) + process(_process) { assert(isPowerOf2(pageSize)); pTableCache[0].vaddr = 0; @@ -80,7 +81,8 @@ PageTable::allocate(Addr vaddr, int64_t size) vaddr); } - pTable[vaddr] = TheISA::TlbEntry(system->new_page()); + pTable[vaddr] = TheISA::TlbEntry(process->M5_pid, vaddr, + process->system->new_page()); updateCache(vaddr, pTable[vaddr]); } } @@ -122,7 +124,7 @@ PageTable::translate(Addr vaddr, Addr &paddr) DPRINTF(MMU, "Couldn't Translate: %#x\n", vaddr); return false; } - paddr = pageOffset(vaddr) + entry.pageStart; + paddr = pageOffset(vaddr) + entry.pageStart(); DPRINTF(MMU, "Translating: %#x->%#x\n", vaddr, paddr); return true; } diff --git a/src/mem/page_table.hh b/src/mem/page_table.hh index 845bb9112..b8b52174c 100644 --- a/src/mem/page_table.hh +++ b/src/mem/page_table.hh @@ -46,7 +46,7 @@ #include "sim/host.hh" #include "sim/serialize.hh" -class System; +class Process; /** * Page Table Declaration. @@ -68,11 +68,11 @@ class PageTable const Addr pageSize; const Addr offsetMask; - System *system; + Process *process; public: - PageTable(System *_system, Addr _pageSize = TheISA::VMPageSize); + PageTable(Process *_process, Addr _pageSize = TheISA::VMPageSize); ~PageTable(); |