From 25ce4dcaa4d4f253ca311d6e6c71ad0d3483d0dd Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Tue, 27 Sep 2016 12:27:20 +0200 Subject: [PATCH] Documentation --- kernel/include/virtual_allocator.hpp | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/kernel/include/virtual_allocator.hpp b/kernel/include/virtual_allocator.hpp index 46b0595b..136abff9 100644 --- a/kernel/include/virtual_allocator.hpp +++ b/kernel/include/virtual_allocator.hpp @@ -16,14 +16,45 @@ namespace virtual_allocator { //The virtual size allocated to the kernel constexpr const size_t kernel_virtual_size = 1_GiB; +/* + * \brief Initialize the vitual allocator. + * + * After this point, the early_allocate function should not be called + */ void init(); + +/*! + * \brief Finalize the vitual allocator, must be called after sysfs initialization + */ void finalize(); +/*! + * \brief Allocate several pages of vitual memory + * \param pages The number of pages + * \return The vitual addres of the allocated pages + */ size_t allocate(size_t pages); + +/*! + * \brief Free the allocated virtual memory + * \param address The address of the allocated virtual memory + * \param pages The number of pages + */ void free(size_t address, size_t pages); +/*! + * \brief Return the amount of virtual memory available + */ size_t available(); + +/*! + * \brief Return the amount of virtual memory allocated + */ size_t allocated(); + +/*! + * \brief Return the amount of virtual memory free + */ size_t free(); } //end of virtual_allocator namespace