[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH] lib/ukboot: Provide option to initialize TLSF



Provides the option to initialize TLSF as allocator. The option is only made
available when `LIBTLSF_INCLUDED` is set. This should be done by the TLSF
library as soon included to Unikraft. It is expected that this solution
intermediate until we are able to dynamically register configuration options to
core libraries.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 lib/ukboot/Config.uk | 5 +++++
 lib/ukboot/boot.c    | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/lib/ukboot/Config.uk b/lib/ukboot/Config.uk
index 57cf1e36..9e2996d7 100644
--- a/lib/ukboot/Config.uk
+++ b/lib/ukboot/Config.uk
@@ -92,6 +92,11 @@ if LIBUKBOOT
                  Satisfy allocation as fast as possible. No support for free().
                  Refer to help in ukallocregion for more information.
 
+               config LIBUKBOOT_INITTLSF
+               bool "TLSF"
+               depends on LIBTLSF_INCLUDED
+               select LIBTLSF
+
                config LIBUKBOOT_NOALLOC
                bool "None"
 
diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index a4e12bf7..2f7ab24a 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -45,6 +45,8 @@
 #include <uk/allocbbuddy.h>
 #elif CONFIG_LIBUKBOOT_INITREGION
 #include <uk/allocregion.h>
+#elif CONFIG_LIBUKBOOT_INITTLSF
+#include <uk/tlsf.h>
 #endif
 #if CONFIG_LIBUKSCHED
 #include <uk/sched.h>
@@ -239,6 +241,8 @@ void ukplat_entry(int argc, char *argv[])
                        a = uk_allocbbuddy_init(md.base, md.len);
 #elif CONFIG_LIBUKBOOT_INITREGION
                        a = uk_allocregion_init(md.base, md.len);
+#elif CONFIG_LIBUKBOOT_INITTLSF
+                       a = uk_tlsf_init(md.base, md.len);
 #endif
                } else {
                        uk_alloc_addmem(a, md.base, md.len);
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.