[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH v2] Provide LIBTLSF_INCLUDED (invisible, always "y")
Introduces 'LIBTLSF_INCLUDED' that can be used to determine if the library was included to the build. It is expected that this option is an intermediate solution until we are able to dynamically register configuration options to other libraries like 'ukboot'. Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> --- Changes since v1: - Remove main-tree.patch - Fix typo --- Config.uk | 6 ++++++ README.md | 5 ----- main-tree.patch | 42 ------------------------------------------ 3 files changed, 6 insertions(+), 47 deletions(-) delete mode 100644 main-tree.patch diff --git a/Config.uk b/Config.uk index 29732d0..d5c2ca1 100644 --- a/Config.uk +++ b/Config.uk @@ -1,3 +1,9 @@ +# Invisible option that is used to detect +# if LIBTLSF is available for configuration +config LIBTLSF_INCLUDED + bool + default y + menuconfig LIBTLSF bool "TLSF - real-time dynamic memory allocator" select LIBUKALLOC_IFMALLOC diff --git a/README.md b/README.md index 2e665a3..4cf8b6e 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,4 @@ TLSF for Unikraft This is the port of the TLSF [0] general-purpose memory allocator for Unikraft as an external library. -How to use this allocator in your unikernel application: - -- apply main-tree.patch to the main tree -- select "TLSF" in `ukboot > Default memory allocator` - [0] http://www.gii.upv.es/tlsf/ diff --git a/main-tree.patch b/main-tree.patch deleted file mode 100644 index ca66278..0000000 --- a/main-tree.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Hugo Lefeuvre <hugo.lefeuvre@xxxxxxxxx> -Subject: Add TLSF entry to the menuconfig and initialize it -diff --git a/lib/ukboot/Config.uk b/lib/ukboot/Config.uk -index a888bc1c..b79b370e 100644 ---- a/lib/ukboot/Config.uk -+++ b/lib/ukboot/Config.uk -@@ -32,6 +32,13 @@ 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" -+ select LIBTLSF -+ help -+ Real-time allocator. Bounded fragmentation, allocation, and -+ deallocation. -+ - config LIBUKBOOT_NOALLOC - bool "No memory allocator" - -diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c -index 4e749aa5..37aafd70 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> -@@ -233,6 +235,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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |