1/* 2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include "paging/64bit/X86PagingStructures64Bit.h" 8 9#include <stdlib.h> 10#include <string.h> 11 12#include <KernelExport.h> 13 14#include <int.h> 15 16#include "paging/64bit/X86PagingMethod64Bit.h" 17 18 19X86PagingStructures64Bit::X86PagingStructures64Bit() 20 : 21 fVirtualPMLTop(NULL) 22{ 23} 24 25 26X86PagingStructures64Bit::~X86PagingStructures64Bit() 27{ 28 // Free the PMLTop. 29 free(fVirtualPMLTop); 30} 31 32 33void 34X86PagingStructures64Bit::Init(uint64* virtualPMLTop, 35 phys_addr_t physicalPMLTop) 36{ 37 fVirtualPMLTop = virtualPMLTop; 38 pgdir_phys = physicalPMLTop; 39} 40 41 42void 43X86PagingStructures64Bit::Delete() 44{ 45 if (are_interrupts_enabled()) 46 delete this; 47 else 48 deferred_delete(this); 49} 50 51