xref: /haiku/src/system/kernel/arch/x86/paging/64bit/X86PagingStructures64Bit.cpp (revision 22440f4105cafc95cc1d49f9bc65bb395c527d86)
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 
19 X86PagingStructures64Bit::X86PagingStructures64Bit()
20 	:
21 	fVirtualPML4(NULL)
22 {
23 }
24 
25 
26 X86PagingStructures64Bit::~X86PagingStructures64Bit()
27 {
28 	// Free the PML4.
29 	free(fVirtualPML4);
30 }
31 
32 
33 void
34 X86PagingStructures64Bit::Init(uint64* virtualPML4, phys_addr_t physicalPML4)
35 {
36 	fVirtualPML4 = virtualPML4;
37 	pgdir_phys = physicalPML4;
38 }
39 
40 
41 void
42 X86PagingStructures64Bit::Delete()
43 {
44 	if (are_interrupts_enabled())
45 		delete this;
46 	else
47 		deferred_delete(this);
48 }
49 
50