Documentation

This commit is contained in:
Baptiste Wicht 2016-09-27 12:27:20 +02:00
parent 42674fc884
commit 25ce4dcaa4
No known key found for this signature in database
GPG Key ID: C5566B6C7F884532

View File

@ -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