Dirty page table. Not yet used.

This commit is contained in:
Ben Vanik
2014-06-02 07:49:45 -07:00
parent ddbebcda6c
commit beb5ee40ee
9 changed files with 56 additions and 3 deletions

View File

@@ -225,9 +225,9 @@ LONG CALLBACK CheckMMIOHandler(PEXCEPTION_POINTERS ex_info) {
} // namespace
XenonMemory::XenonMemory() :
mapping_(0), mapping_base_(0),
Memory() {
XenonMemory::XenonMemory()
: Memory(),
mapping_(0), mapping_base_(0), page_table_(0) {
virtual_heap_ = new XenonMemoryHeap(this, false);
physical_heap_ = new XenonMemoryHeap(this, true);
}
@@ -329,6 +329,13 @@ int XenonMemory::Initialize() {
//AddVectoredContinueHandler(1, CheckMMIOHandler);
}
// Allocate dirty page table.
// This must live within our low heap. Ideally we'd hardcode the address but
// this is more flexible.
page_table_ = physical_heap_->Alloc(
0, (512 * 1024 * 1024) / (16 * 1024),
X_MEM_COMMIT, 16 * 1024);
return 0;
XECLEANUP:

View File

@@ -33,6 +33,8 @@ public:
int Initialize() override;
uint64_t page_table() const override { return page_table_; }
bool AddMappedRange(uint64_t address, uint64_t mask,
uint64_t size,
void* context,
@@ -83,6 +85,8 @@ private:
XenonMemoryHeap* virtual_heap_;
XenonMemoryHeap* physical_heap_;
uint64_t page_table_;
friend class XenonMemoryHeap;
};