From d7205f0083f8fdd0408404ce99c6eab9b8d120c7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 8 Apr 2020 17:14:41 +0200 Subject: libc: Optimize malloc() initialization The BSPs provide memory for the separate C Program Heap initialization via _Memory_Get(). Most BSPs provide exactly one memory area. Only two BSPs provide more than one memory area (arm/altera-cyclone-v and bsps/powerpc/mpc55xxevb). Only if more than one memory area is provided, there is a need to use _Heap_Extend(). Provide two implementations to initialize the separate C Program Heap and let the BSP select one of the implementations based on the number of provided memory areas. This gets rid of a dependency on _Heap_Extend(). It also avoids dead code sections for most BSPs. Change licence to BSD-2-Clause according to file history. Update #3053. --- spec/build/bsps/powerpc/mpc55xxevb/obj.yml | 1 + spec/build/bsps/powerpc/objmem.yml | 1 + spec/build/bsps/powerpc/qoriq/obj.yml | 1 + spec/build/bsps/powerpc/tqm8xx/obj.yml | 1 + 4 files changed, 4 insertions(+) (limited to 'spec/build/bsps/powerpc') diff --git a/spec/build/bsps/powerpc/mpc55xxevb/obj.yml b/spec/build/bsps/powerpc/mpc55xxevb/obj.yml index 1325473d86..9b6daa9adf 100644 --- a/spec/build/bsps/powerpc/mpc55xxevb/obj.yml +++ b/spec/build/bsps/powerpc/mpc55xxevb/obj.yml @@ -94,6 +94,7 @@ source: - bsps/shared/irq/irq-default-handler.c - bsps/shared/start/bspfatal-default.c - bsps/shared/start/gettargethash-default.c +- bsps/shared/start/mallocinitmulti.c - bsps/shared/start/stackalloc.c - bsps/shared/start/wkspaceinitmulti.c type: build diff --git a/spec/build/bsps/powerpc/objmem.yml b/spec/build/bsps/powerpc/objmem.yml index 1fbb8b4fb0..3ef079ee72 100644 --- a/spec/build/bsps/powerpc/objmem.yml +++ b/spec/build/bsps/powerpc/objmem.yml @@ -11,5 +11,6 @@ install: [] links: [] source: - bsps/powerpc/shared/start/bspgetworkarea.c +- bsps/shared/start/mallocinitone.c - bsps/shared/start/wkspaceinitone.c type: build diff --git a/spec/build/bsps/powerpc/qoriq/obj.yml b/spec/build/bsps/powerpc/qoriq/obj.yml index c3222125e8..133703a6d5 100644 --- a/spec/build/bsps/powerpc/qoriq/obj.yml +++ b/spec/build/bsps/powerpc/qoriq/obj.yml @@ -72,6 +72,7 @@ source: - bsps/shared/start/bsp-fdt.c - bsps/shared/start/bspfatal-default.c - bsps/shared/start/gettargethash-default.c +- bsps/shared/start/mallocinitone.c - bsps/shared/start/sbrk.c - bsps/shared/start/wkspaceinitone.c type: build diff --git a/spec/build/bsps/powerpc/tqm8xx/obj.yml b/spec/build/bsps/powerpc/tqm8xx/obj.yml index 7aec916350..360e99c864 100644 --- a/spec/build/bsps/powerpc/tqm8xx/obj.yml +++ b/spec/build/bsps/powerpc/tqm8xx/obj.yml @@ -46,6 +46,7 @@ source: - bsps/shared/start/bspfatal-default.c - bsps/shared/start/bspreset-empty.c - bsps/shared/start/gettargethash-default.c +- bsps/shared/start/mallocinitone.c - bsps/shared/start/sbrk.c - bsps/shared/start/wkspaceinitone.c type: build -- cgit v1.2.3