mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-18 17:15:09 -04:00
Documentation
This commit is contained in:
parent
42674fc884
commit
25ce4dcaa4
@ -16,14 +16,45 @@ namespace virtual_allocator {
|
|||||||
//The virtual size allocated to the kernel
|
//The virtual size allocated to the kernel
|
||||||
constexpr const size_t kernel_virtual_size = 1_GiB;
|
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();
|
void init();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Finalize the vitual allocator, must be called after sysfs initialization
|
||||||
|
*/
|
||||||
void finalize();
|
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);
|
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);
|
void free(size_t address, size_t pages);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return the amount of virtual memory available
|
||||||
|
*/
|
||||||
size_t available();
|
size_t available();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return the amount of virtual memory allocated
|
||||||
|
*/
|
||||||
size_t allocated();
|
size_t allocated();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return the amount of virtual memory free
|
||||||
|
*/
|
||||||
size_t free();
|
size_t free();
|
||||||
|
|
||||||
} //end of virtual_allocator namespace
|
} //end of virtual_allocator namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user