aboutsummaryrefslogtreecommitdiff
path: root/kapi/include
diff options
context:
space:
mode:
Diffstat (limited to 'kapi/include')
-rw-r--r--kapi/include/kapi/memory.hpp6
-rw-r--r--kapi/include/kapi/memory/frame_allocator.hpp19
2 files changed, 23 insertions, 2 deletions
diff --git a/kapi/include/kapi/memory.hpp b/kapi/include/kapi/memory.hpp
index 3ad5ac5..3daaa86 100644
--- a/kapi/include/kapi/memory.hpp
+++ b/kapi/include/kapi/memory.hpp
@@ -1,11 +1,13 @@
#ifndef TEACHOS_KAPI_MEMORY_HPP
#define TEACHOS_KAPI_MEMORY_HPP
-#include "kapi/memory/address.hpp" // IWYU pragma: export
-#include "kapi/memory/frame.hpp" // IWYU pragma: export
+#include "kapi/memory/address.hpp" // IWYU pragma: export
+#include "kapi/memory/frame.hpp" // IWYU pragma: export
+#include "kapi/memory/frame_allocator.hpp" // IWYU pragma: export
namespace teachos::memory
{
+ auto active_allocator() -> frame_allocator &;
auto init() -> void;
} // namespace teachos::memory
diff --git a/kapi/include/kapi/memory/frame_allocator.hpp b/kapi/include/kapi/memory/frame_allocator.hpp
new file mode 100644
index 0000000..f9393ee
--- /dev/null
+++ b/kapi/include/kapi/memory/frame_allocator.hpp
@@ -0,0 +1,19 @@
+#ifndef TEACHOS_KAPI_MEMORY_FRAME_ALLOCATOR_HPP
+#define TEACHOS_KAPI_MEMORY_FRAME_ALLOCATOR_HPP
+
+#include "kapi/memory/frame.hpp"
+
+#include <optional>
+
+namespace teachos::memory
+{
+
+ struct frame_allocator
+ {
+ virtual auto allocate() -> std::optional<frame> = 0;
+ virtual auto release(frame frame) -> void = 0;
+ };
+
+} // namespace teachos::memory
+
+#endif // TEACHOS_KAPI_MEMORY_FRAME_ALLOCATOR_HPP \ No newline at end of file