2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
7 #include "paging/pae/X86PagingStructuresPAE.h"
12 #include <KernelExport.h>
16 #include "paging/pae/X86PagingMethodPAE.h"
19 #if B_HAIKU_PHYSICAL_BITS == 64
22 X86PagingStructuresPAE::X86PagingStructuresPAE()
24 fPageDirPointerTable(NULL
)
26 memset(fVirtualPageDirs
, 0, sizeof(fVirtualPageDirs
));
30 X86PagingStructuresPAE::~X86PagingStructuresPAE()
32 // free the user page dirs
33 free(fVirtualPageDirs
[0]);
34 // There's one contiguous allocation for 0 and 1.
37 if (fPageDirPointerTable
!= NULL
) {
38 X86PagingMethodPAE::Method()->Free32BitPage(fPageDirPointerTable
,
39 pgdir_phys
, fPageDirPointerTableHandle
);
45 X86PagingStructuresPAE::Init(
46 pae_page_directory_pointer_table_entry
* virtualPDPT
,
47 phys_addr_t physicalPDPT
, void* pdptHandle
,
48 pae_page_directory_entry
* const* virtualPageDirs
,
49 const phys_addr_t
* physicalPageDirs
)
51 fPageDirPointerTable
= virtualPDPT
;
52 pgdir_phys
= physicalPDPT
;
53 fPageDirPointerTableHandle
= pdptHandle
;
54 memcpy(fVirtualPageDirs
, virtualPageDirs
, sizeof(fVirtualPageDirs
));
55 memcpy(fPhysicalPageDirs
, physicalPageDirs
, sizeof(fPhysicalPageDirs
));
60 X86PagingStructuresPAE::Delete()
62 if (are_interrupts_enabled())
65 deferred_delete(this);
69 #endif // B_HAIKU_PHYSICAL_BITS == 64