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

View File

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