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