From e5764d91ea24cf317191f055493ec9de0158f75b Mon Sep 17 00:00:00 2001 From: Nathan Giddings Date: Fri, 11 Dec 2020 09:16:53 -0600 Subject: [PATCH] Added pageSize() method to memory manager --- src/memorymanager.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/memorymanager.hpp b/src/memorymanager.hpp index 96d9c39..f8259ff 100644 --- a/src/memorymanager.hpp +++ b/src/memorymanager.hpp @@ -1,12 +1,19 @@ #ifndef MEMORYMANAGER_H #define MEMORYMANAGER_H -#include "systypes.h" +#include "systypes.hpp" class MemoryManager { public: + /** + * @brief Returns the size of a single page on the present platform. + * + * @return the size in bytes of a single page + */ + virtual unsigned int pageSize() const = 0; + /** * Allocates space for a new top-level page table, and initializes it to * point only to the kernel's page tables. @@ -40,10 +47,8 @@ public: * after the owning process ends. * * @param page the virtual address of the page to unmap - * - * @returns zero upon success, nonzero on failure */ - virtual int unmapPage(void* page) = 0; + virtual physaddr_t unmapPage(void* page) = 0; };