* Declaration of a non-full system Page Table.
*/
-#ifndef __PAGE_TABLE__
-#define __PAGE_TABLE__
+#ifndef __MEM_PAGE_TABLE_HH__
+#define __MEM_PAGE_TABLE_HH__
#include <string>
-#include "sim/faults.hh"
#include "arch/isa_traits.hh"
#include "arch/tlb.hh"
#include "base/hashmap.hh"
+#include "base/types.hh"
+#include "config/the_isa.hh"
#include "mem/request.hh"
-#include "sim/host.hh"
#include "sim/serialize.hh"
-class System;
+class Process;
/**
* Page Table Declaration.
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();
Addr pageOffset(Addr a) { return (a & offsetMask); }
void allocate(Addr vaddr, int64_t size);
+ void remap(Addr vaddr, int64_t size, Addr new_vaddr);
+ void deallocate(Addr vaddr, int64_t size);
/**
* Lookup function
/**
* Translate function
* @param vaddr The virtual address.
- * @return Physical address from translation.
+ * @param paddr Physical address from translation.
+ * @return True if translation exists
*/
bool translate(Addr vaddr, Addr &paddr);
+ /**
+ * Simplified translate function (just check for translation)
+ * @param vaddr The virtual address.
+ * @return True if translation exists
+ */
+ bool translate(Addr vaddr) { Addr dummy; return translate(vaddr, dummy); }
+
/**
* Perform a translation on the memory request, fills in paddr
* field of req.
void unserialize(Checkpoint *cp, const std::string §ion);
};
-#endif
+#endif // __MEM_PAGE_TABLE_HH__