aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/kapi/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/kapi/memory.cpp')
-rw-r--r--kernel/src/kapi/memory.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/src/kapi/memory.cpp b/kernel/src/kapi/memory.cpp
index 2f707ec..ebd4c15 100644
--- a/kernel/src/kapi/memory.cpp
+++ b/kernel/src/kapi/memory.cpp
@@ -15,14 +15,14 @@ namespace teachos::memory
{
bad_frame_allocator static instance;
- auto allocate() noexcept -> std::optional<frame> override
+ auto allocate_many(std::size_t) noexcept -> std::optional<std::pair<frame, std::size_t>> override
{
- system::panic("Tried to allocate a frame without an active allocator.");
+ system::panic("Tried to allocate frames without an active allocator.");
}
- auto release(frame) -> void override
+ auto release_many(std::pair<frame, std::size_t>) -> void override
{
- system::panic("Tried to release a frame without an active allocator.");
+ system::panic("Tried to release frames without an active allocator.");
}
};
@@ -76,6 +76,11 @@ namespace teachos::memory
return active_frame_allocator->allocate();
}
+ auto allocate_many_frames(std::size_t count) -> std::optional<std::pair<frame, std::size_t>>
+ {
+ return active_frame_allocator->allocate_many(count);
+ }
+
auto map(page page, frame frame) -> std::byte *
{
return active_page_mapper->map(page, frame, page_mapper::flags::empty);