Kernel: Invalid physical addresses from heap are specified now by 0

This commit is contained in:
Bananymous
2023-05-06 01:03:04 +03:00
parent ab8aac7dcf
commit 9c07add00f
3 changed files with 5 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ namespace Kernel
paddr_t PhysicalRange::reserve_page()
{
if (m_free_list == nullptr)
return invalid;
return 0;
node* page = m_free_list;
ASSERT(page->next == nullptr);
@@ -161,7 +161,7 @@ namespace Kernel
paddr_t Heap::take_free_page()
{
for (auto& range : m_physical_ranges)
if (paddr_t page = range.reserve_page(); page != PhysicalRange::invalid)
if (paddr_t page = range.reserve_page())
return page;
ASSERT_NOT_REACHED();
}