[PATCH 0/5] Optimize workspace/malloc initialization
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Nov 29 10:29:21 UTC 2021
The BSPs provide memory for the RTEMS Workspace and 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 RTEMS Workspace and the
separate C Program Heap. 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.
Sebastian Huber (5):
wkspace.c: Change license to BSD-2-Clause
score: Split wkspace.c
build: Use common objects item for get memory
score: Optimize Workspace Handler initialization
libc: Optimize malloc() initialization
bsps/shared/start/mallocinitmany.c | 49 +++++++
bsps/shared/start/mallocinitone.c | 49 +++++++
bsps/shared/start/wkspaceinitmany.c | 46 +++++++
bsps/shared/start/wkspaceinitone.c | 46 +++++++
cpukit/include/rtems/malloc.h | 6 +-
cpukit/include/rtems/mallocinitmany.h | 100 ++++++++++++++
cpukit/include/rtems/mallocinitone.h | 90 ++++++++++++
cpukit/include/rtems/score/wkspace.h | 12 +-
cpukit/include/rtems/score/wkspaceinitmany.h | 129 ++++++++++++++++++
cpukit/include/rtems/score/wkspaceinitone.h | 113 +++++++++++++++
cpukit/libcsupport/src/malloc_initialize.c | 81 -----------
cpukit/libcsupport/src/mallocheap.c | 2 +-
cpukit/score/src/wkspace.c | 125 ++++-------------
cpukit/score/src/wkspaceallocate.c | 47 +++++++
cpukit/score/src/wkspacefree.c | 51 +++++++
spec/build/bsps/aarch64/a53/grp.yml | 2 +
spec/build/bsps/aarch64/a53/obj.yml | 1 -
spec/build/bsps/aarch64/a72/grp.yml | 2 +
spec/build/bsps/aarch64/a72/obj.yml | 1 -
spec/build/bsps/aarch64/xilinx-versal/grp.yml | 2 +
spec/build/bsps/aarch64/xilinx-versal/obj.yml | 1 -
spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml | 2 +
spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml | 1 -
.../altera-cyclone-v/bspalteracyclonev.yml | 2 +
spec/build/bsps/arm/atsam/bspatsam.yml | 3 +-
spec/build/bsps/arm/beagle/grp.yml | 2 +
spec/build/bsps/arm/beagle/obj.yml | 1 -
spec/build/bsps/arm/csb336/bspcsb336.yml | 3 +-
spec/build/bsps/arm/csb337/grp.yml | 2 +
spec/build/bsps/arm/csb337/obj.yml | 1 -
spec/build/bsps/arm/edb7312/bspedb7312.yml | 3 +-
spec/build/bsps/arm/fvp/grp.yml | 2 +
spec/build/bsps/arm/fvp/obj.yml | 1 -
spec/build/bsps/arm/gumstix/bspgumstix.yml | 3 +-
spec/build/bsps/arm/imxrt/bspimxrt.yml | 3 +-
spec/build/bsps/arm/lm3s69xx/grp.yml | 2 +
spec/build/bsps/arm/lm3s69xx/obj.yml | 1 -
spec/build/bsps/arm/lpc176x/grp.yml | 2 +
spec/build/bsps/arm/lpc176x/obj.yml | 1 -
spec/build/bsps/arm/lpc24xx/grp.yml | 2 +
spec/build/bsps/arm/lpc24xx/obj.yml | 1 -
spec/build/bsps/arm/lpc32xx/grp.yml | 2 +
spec/build/bsps/arm/lpc32xx/obj.yml | 1 -
.../arm/realview-pbx-a9/bsprealviewpbxa9.yml | 3 +-
spec/build/bsps/arm/rtl22xx/grp.yml | 2 +
spec/build/bsps/arm/rtl22xx/obj.yml | 1 -
spec/build/bsps/arm/smdk2410/bspsmdk2410.yml | 3 +-
spec/build/bsps/arm/stm32f4/grp.yml | 2 +
spec/build/bsps/arm/stm32f4/obj.yml | 1 -
spec/build/bsps/arm/stm32h7/grp.yml | 2 +
spec/build/bsps/arm/stm32h7/obj.yml | 1 -
spec/build/bsps/arm/tms570/grp.yml | 2 +
spec/build/bsps/arm/tms570/obj.yml | 1 -
spec/build/bsps/arm/xen/bspxen.yml | 3 +-
spec/build/bsps/arm/xilinx-zynq/grp.yml | 2 +
spec/build/bsps/arm/xilinx-zynq/obj.yml | 1 -
.../arm/xilinx-zynqmp/bspxilinxzynqmp.yml | 3 +-
spec/build/bsps/bfin/TLL6527M/bsptll6527m.yml | 3 +-
.../bsps/bfin/bf537Stamp/bspbf537stamp.yml | 3 +-
spec/build/bsps/bfin/eZKit533/bspezkit533.yml | 3 +-
spec/build/bsps/i386/pc386/obj.yml | 2 +
spec/build/bsps/lm32/lm32_evr/grp.yml | 2 +
spec/build/bsps/lm32/lm32_evr/obj.yml | 1 -
.../bsps/lm32/milkymist/bspmilkymist.yml | 3 +-
spec/build/bsps/m68k/av5282/bspav5282.yml | 3 +-
spec/build/bsps/m68k/csb360/bspcsb360.yml | 3 +-
spec/build/bsps/m68k/gen68340/bspgen68340.yml | 3 +-
spec/build/bsps/m68k/gen68360/grp.yml | 2 +
spec/build/bsps/m68k/gen68360/obj.yml | 1 -
spec/build/bsps/m68k/genmcf548x/grp.yml | 2 +
spec/build/bsps/m68k/genmcf548x/obj.yml | 1 -
.../m68k/mcf5206elite/bspmcf5206elite.yml | 3 +-
spec/build/bsps/m68k/mcf52235/bspmcf52235.yml | 3 +-
spec/build/bsps/m68k/mcf5225x/bspmcf5225x.yml | 3 +-
spec/build/bsps/m68k/mcf5235/bspmcf5235.yml | 3 +-
spec/build/bsps/m68k/mcf5329/bspmcf5329.yml | 3 +-
spec/build/bsps/m68k/mrm332/bspmrm332.yml | 3 +-
spec/build/bsps/m68k/mvme147/bspmvme147.yml | 3 +-
spec/build/bsps/m68k/mvme147s/bspmvme147s.yml | 3 +-
spec/build/bsps/m68k/mvme162/grp.yml | 2 +
spec/build/bsps/m68k/mvme162/obj.yml | 1 -
spec/build/bsps/m68k/mvme167/bspmvme167.yml | 3 +-
spec/build/bsps/m68k/uC5282/bspuc5282.yml | 3 +-
.../bsps/microblaze/microblaze_fpga/grp.yml | 2 +
.../bsps/microblaze/microblaze_fpga/obj.yml | 1 -
spec/build/bsps/mips/csb350/bspcsb350.yml | 3 +-
.../bsps/mips/hurricane/bsphurricane.yml | 3 +-
spec/build/bsps/mips/jmr3904/bspjmr3904.yml | 3 +-
spec/build/bsps/mips/malta/bspmalta.yml | 3 +-
spec/build/bsps/mips/rbtx4925/bsprbtx4925.yml | 3 +-
spec/build/bsps/mips/rbtx4938/bsprbtx4938.yml | 3 +-
.../build/bsps/moxie/moxiesim/bspmoxiesim.yml | 3 +-
.../bsps/nios2/nios2_iss/bspnios2iss.yml | 3 +-
spec/build/bsps/objmem.yml | 16 +++
.../bsps/or1k/generic_or1k/bspgenericor1k.yml | 3 +-
.../build/bsps/powerpc/beatnik/bspbeatnik.yml | 3 +-
spec/build/bsps/powerpc/gen5200/grp.yml | 2 +
spec/build/bsps/powerpc/gen5200/obj.yml | 1 -
spec/build/bsps/powerpc/gen83xx/grp.yml | 2 +
spec/build/bsps/powerpc/gen83xx/obj.yml | 1 -
.../bsps/powerpc/haleakala/bsphaleakala.yml | 3 +-
.../bsps/powerpc/motorola_powerpc/grp.yml | 2 +
.../bsps/powerpc/motorola_powerpc/obj.yml | 1 -
spec/build/bsps/powerpc/mpc55xxevb/obj.yml | 2 +
.../bsps/powerpc/mpc8260ads/bspmpc8260ads.yml | 3 +-
.../bsps/powerpc/mvme3100/bspmvme3100.yml | 3 +-
.../bsps/powerpc/mvme5500/bspmvme5500.yml | 3 +-
spec/build/bsps/powerpc/objmem.yml | 16 +++
spec/build/bsps/powerpc/psim/bsppsim.yml | 3 +-
.../build/bsps/powerpc/qemuppc/bspqemuppc.yml | 3 +-
spec/build/bsps/powerpc/ss555/bspss555.yml | 3 +-
.../build/bsps/powerpc/t32mppc/bspt32mppc.yml | 3 +-
spec/build/bsps/powerpc/tqm8xx/obj.yml | 2 +
spec/build/bsps/powerpc/virtex/bspvirtex.yml | 3 +-
.../build/bsps/powerpc/virtex4/bspvirtex4.yml | 3 +-
.../build/bsps/powerpc/virtex5/bspvirtex5.yml | 3 +-
spec/build/bsps/riscv/griscv/grp.yml | 2 +
spec/build/bsps/riscv/griscv/obj.yml | 1 -
spec/build/bsps/riscv/riscv/grp.yml | 2 +
spec/build/bsps/riscv/riscv/obj.yml | 1 -
spec/build/bsps/sh/gensh1/bspgensh1.yml | 3 +-
spec/build/bsps/sh/gensh2/bspgensh2.yml | 3 +-
spec/build/bsps/sh/gensh4/bspgensh4.yml | 3 +-
spec/build/bsps/sh/shsim/grp.yml | 2 +
spec/build/bsps/sh/shsim/obj.yml | 1 -
spec/build/bsps/sparc/erc32/bsperc32.yml | 3 +-
spec/build/bsps/sparc/leon2/grp.yml | 2 +
spec/build/bsps/sparc/leon2/obj.yml | 1 -
spec/build/bsps/sparc/leon3/grp.yml | 2 +
spec/build/bsps/sparc/leon3/obj.yml | 1 -
spec/build/bsps/sparc/objmem.yml | 16 +++
.../build/bsps/sparc64/niagara/bspniagara.yml | 3 +-
spec/build/bsps/sparc64/usiii/bspusiii.yml | 3 +-
spec/build/bsps/v850/gdbv850sim/grp.yml | 2 +
spec/build/bsps/v850/gdbv850sim/obj.yml | 1 -
spec/build/bsps/x86_64/amd64/bspamd64.yml | 3 +-
spec/build/cpukit/librtemscpu.yml | 3 +-
testsuites/libtests/malloc04/init.c | 37 +++--
138 files changed, 998 insertions(+), 296 deletions(-)
create mode 100644 bsps/shared/start/mallocinitmany.c
create mode 100644 bsps/shared/start/mallocinitone.c
create mode 100644 bsps/shared/start/wkspaceinitmany.c
create mode 100644 bsps/shared/start/wkspaceinitone.c
create mode 100644 cpukit/include/rtems/mallocinitmany.h
create mode 100644 cpukit/include/rtems/mallocinitone.h
create mode 100644 cpukit/include/rtems/score/wkspaceinitmany.h
create mode 100644 cpukit/include/rtems/score/wkspaceinitone.h
delete mode 100644 cpukit/libcsupport/src/malloc_initialize.c
create mode 100644 cpukit/score/src/wkspaceallocate.c
create mode 100644 cpukit/score/src/wkspacefree.c
create mode 100644 spec/build/bsps/objmem.yml
create mode 100644 spec/build/bsps/powerpc/objmem.yml
create mode 100644 spec/build/bsps/sparc/objmem.yml
--
2.31.1
More information about the devel
mailing list