aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-10-29 11:40:49 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-10-29 11:40:49 +0100
commit845a96f5e6bfbbbeba19bf3df07f0e9de53d9a88 (patch)
tree07803f43051bdd27aa3eb947103320473b6e1b5d /arch/x86_64/include
parente7b04ef7f5da8e014e8b85fcf65448b317cca8ff (diff)
downloadteachos-845a96f5e6bfbbbeba19bf3df07f0e9de53d9a88.tar.xz
teachos-845a96f5e6bfbbbeba19bf3df07f0e9de53d9a88.zip
kapi: export frame_allocator interface
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/x86_64/memory/region_allocator.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/include/x86_64/memory/region_allocator.hpp b/arch/x86_64/include/x86_64/memory/region_allocator.hpp
index a918195..913b0bb 100644
--- a/arch/x86_64/include/x86_64/memory/region_allocator.hpp
+++ b/arch/x86_64/include/x86_64/memory/region_allocator.hpp
@@ -3,6 +3,7 @@
#include "kapi/memory/address.hpp"
#include "kapi/memory/frame.hpp"
+#include "kapi/memory/frame_allocator.hpp"
#include <multiboot2/information.hpp>
@@ -15,7 +16,7 @@ namespace teachos::memory::x86_64
* @brief Allocates memory linearly using memory areas read from the multiboot2 information pointer and leaks any
* deallocated frames.
*/
- struct region_allocator
+ struct region_allocator final : frame_allocator
{
struct memory_information
{
@@ -43,7 +44,7 @@ namespace teachos::memory::x86_64
*
* @return next free physical frame or nullopt if none was found.
*/
- auto allocate_frame() -> std::optional<frame>;
+ auto allocate() -> std::optional<frame> override;
/**
* @brief Deallocates a previously allocated physical frame.
@@ -54,7 +55,7 @@ namespace teachos::memory::x86_64
*
* @param physical_frame Previously allocated physical_frame that should be deallocated.
*/
- auto deallocate_frame(frame const & physical_frame) -> void;
+ auto release(frame frame) -> void override;
private:
/**