diff --git a/prototypes/base/include/pmm.hpp b/prototypes/base/include/pmm.hpp index b67e578..967ee6d 100644 --- a/prototypes/base/include/pmm.hpp +++ b/prototypes/base/include/pmm.hpp @@ -11,10 +11,9 @@ private: PMM() = delete; public: /** - * Marks a page as occupied by external memory management. - * @returns true if the page was previously free, false if it was already allocated. + * Marks a page as free by external memory management. */ - static bool markOccupied(physical_t page); + static void markFree(physical_t page); /** * Allocates a single page. diff --git a/prototypes/base/src/pmm.cpp b/prototypes/base/src/pmm.cpp index d3b2f4d..27598a0 100644 --- a/prototypes/base/src/pmm.cpp +++ b/prototypes/base/src/pmm.cpp @@ -14,8 +14,8 @@ static const uint32_t BitmapLength = BitmapSize / 32; /** * Bitmap that stores the page status. - * A set bit marks a used page - * An unset bit marks an unused page + * A set bit marks a page as free. + * An unset bit marks a page as used. */ static uint32_t bitmap[BitmapLength]; @@ -27,7 +27,7 @@ static bool isAligned(uint32_t ptr) return (ptr % 4096) == 0; } -bool PMM::markOccupied(physical_t page) +void PMM::markFree(physical_t page) { uint32_t ptr = page.numeric(); if(!isAligned(ptr)) @@ -37,26 +37,25 @@ bool PMM::markOccupied(physical_t page) uint32_t idx = pageId / 32; uint32_t bit = pageId % 32; - bool wasSet = (bitmap[idx] & (1<