Kernel: Make PageTable non-copyable and non-movable
Also PageTable destructor now verifies that is has allocated something instead of assuming paddr of 0.
This commit is contained in:
parent
6f118c1be1
commit
48e030bca3
|
@ -272,6 +272,9 @@ namespace Kernel
|
||||||
|
|
||||||
PageTable::~PageTable()
|
PageTable::~PageTable()
|
||||||
{
|
{
|
||||||
|
if (m_highest_paging_struct == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
uint64_t* pdpt = reinterpret_cast<uint64_t*>(P2V(m_highest_paging_struct));
|
uint64_t* pdpt = reinterpret_cast<uint64_t*>(P2V(m_highest_paging_struct));
|
||||||
|
|
||||||
for (uint32_t pdpte = 0; pdpte < 3; pdpte++)
|
for (uint32_t pdpte = 0; pdpte < 3; pdpte++)
|
||||||
|
|
|
@ -576,6 +576,9 @@ namespace Kernel
|
||||||
|
|
||||||
PageTable::~PageTable()
|
PageTable::~PageTable()
|
||||||
{
|
{
|
||||||
|
if (m_highest_paging_struct == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
// NOTE: we only loop until 256 since after that is hhdm
|
// NOTE: we only loop until 256 since after that is hhdm
|
||||||
const uint64_t* pml4 = P2V(m_highest_paging_struct);
|
const uint64_t* pml4 = P2V(m_highest_paging_struct);
|
||||||
for (uint64_t pml4e = 0; pml4e < 256; pml4e++)
|
for (uint64_t pml4e = 0; pml4e < 256; pml4e++)
|
||||||
|
|
|
@ -22,6 +22,9 @@ namespace Kernel
|
||||||
|
|
||||||
class PageTable
|
class PageTable
|
||||||
{
|
{
|
||||||
|
BAN_NON_COPYABLE(PageTable);
|
||||||
|
BAN_NON_MOVABLE(PageTable);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using flags_t = uint16_t;
|
using flags_t = uint16_t;
|
||||||
enum Flags : flags_t
|
enum Flags : flags_t
|
||||||
|
|
Loading…
Reference in New Issue