[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v3 0/7] Provide library constructors
This patch series adds the arrays called preinit_array and init_array to the Unikraft binaries. These arrays contain function pointers to constructors and they are populated during link time. Libraries can register a function to it by marking its init function(s) with a new attribute macro called __constructor (provided with `include/uk/essentials.h`). The bootstrapping library `libukboot` is executing each of these functions during boot so that libraries can execute necessary early-initialization routines (before scheduling and before memory allocators are initialized). Changes to v1/v2: - Instead of introducing ukplat_ctortab, use the common preinit_array and init_array sections. Calling constructors with this method, we keep compatibility with existing libraries and language runtimes (e.g., C++). - The __used and __section macros in `include/uk/essentials.h` are not needed anymore but are kept in this updated patch series since they are anyway useful. Simon Kuenzer (7): include/essentials: Provide __used, __section macros plat/kvm: Align linker script with Xen platform ones plat/kvm: Add preinit_array and init_array sections (x86) plat/xen: Add preinit_array and init_array sections (x86, ARM) include/essentials: Provide __constructor macro include: Add ctors.h header for iterating over init arrays lib/ukboot: Call constructors from initarrays include/uk/essentials.h | 19 +++++++++ include/uk/plat/ctors.h | 75 ++++++++++++++++++++++++++++++++ lib/ukboot/boot.c | 32 ++++++++++++-- plat/kvm/memory.c | 44 ++++++++++++++----- plat/kvm/x86/entry64.S | 2 +- plat/kvm/x86/link64.ld | 111 +++++++++++++++++++++++++----------------------- plat/kvm/x86/setup.c | 2 +- plat/xen/arm/link32.ld | 43 +++++++++---------- plat/xen/memory.c | 10 ++--- plat/xen/x86/link64.ld | 17 ++++++++ 10 files changed, 257 insertions(+), 98 deletions(-) create mode 100644 include/uk/plat/ctors.h -- 2.7.4 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |