From 42674fc88495140f391d67e8ff148a50a25a9ee4 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Tue, 27 Sep 2016 12:25:34 +0200 Subject: [PATCH] Doc --- kernel/include/physical_allocator.hpp | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/kernel/include/physical_allocator.hpp b/kernel/include/physical_allocator.hpp index 9e977eeb..068767af 100644 --- a/kernel/include/physical_allocator.hpp +++ b/kernel/include/physical_allocator.hpp @@ -12,18 +12,58 @@ namespace physical_allocator { +/*! + * \brief Early initialization of the physical allocator. + * + * This finalizes the e820 memory detection and start preparing memory from one of the blocks + */ void early_init(); +/*! + * \brief Early allocation of physical memory pages + * \param pages The number of pages to allocate + */ size_t early_allocate(size_t pages); +/* + * \brief Initialize the real physical allocator. + * + * After this point, the early_allocate function should not be called + */ void init(); + +/*! + * \brief Finalize the physical allocator, must be called after sysfs initialization + */ void finalize(); +/*! + * \brief Allocate several pages of physical memory + * \param pages The number of pages + * \return The physical addres of the allocated pages + */ size_t allocate(size_t pages); + +/*! + * \brief Free the allocated physical memory + * \param address The address of the allocated physical memory + * \param pages The number of pages + */ void free(size_t address, size_t pages); +/*! + * \brief Return the amount of physical memory available + */ size_t available(); + +/*! + * \brief Return the amount of physical memory allocated + */ size_t allocated(); + +/*! + * \brief Return the amount of physical memory free + */ size_t free(); } //end of physical_allocator namespace