If paging is disabled, ensure compatibility with memory allocators
such as TLSF, by only adding page-aligned free memory regions to the
memory allocator pools. Throw an exception otherwise.
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1060
#ifdef CONFIG_LIBUKSP
#include <uk/sp.h>
#endif
+#include <uk/arch/paging.h>
#include <uk/arch/tls.h>
#include <uk/plat/tls.h>
#include "banner.h"
* add every subsequent region to it.
*/
ukplat_memregion_foreach(&md, UKPLAT_MEMRT_FREE, 0, 0) {
+ UK_ASSERT(md->vbase == md->pbase);
+ UK_ASSERT(!(md->pbase & ~PAGE_MASK));
+ UK_ASSERT(md->len);
+ UK_ASSERT(!(md->len & ~PAGE_MASK));
+
uk_pr_debug("Trying %p-%p 0x%02x %s\n",
(void *)md->vbase, (void *)(md->vbase + md->len),
md->flags,