Added pageSize() method to memory manager

This commit is contained in:
Nathan Giddings
2020-12-11 09:16:53 -06:00
parent a099a6dc10
commit e5764d91ea

View File

@@ -1,12 +1,19 @@
#ifndef MEMORYMANAGER_H #ifndef MEMORYMANAGER_H
#define MEMORYMANAGER_H #define MEMORYMANAGER_H
#include "systypes.h" #include "systypes.hpp"
class MemoryManager class MemoryManager
{ {
public: 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 * Allocates space for a new top-level page table, and initializes it to
* point only to the kernel's page tables. * point only to the kernel's page tables.
@@ -40,10 +47,8 @@ public:
* after the owning process ends. * after the owning process ends.
* *
* @param page the virtual address of the page to unmap * @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;
}; };