Index: c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -86,5 +86,5 @@
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bsp-fdt.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-exception-handler.c
Index: c/src/lib/libbsp/arm/atsam/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/atsam/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/atsam/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -40,5 +40,5 @@
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 
 # libchip
Index: c/src/lib/libbsp/arm/beagle/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/beagle/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/beagle/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -44,5 +44,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/gpio.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
Index: c/src/lib/libbsp/arm/imx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/imx/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/imx/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -38,5 +38,5 @@
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bsp-fdt.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-exception-handler.c
Index: c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/lm3s69xx/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/lm3s69xx/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -39,5 +39,5 @@
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 
 # Startup
Index: c/src/lib/libbsp/arm/lpc176x/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/lpc176x/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/lpc176x/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -46,5 +46,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/src/uart-output-char.c
 
Index: c/src/lib/libbsp/arm/lpc24xx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/lpc24xx/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/lpc24xx/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -55,5 +55,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/src/uart-output-char.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
Index: c/src/lib/libbsp/arm/lpc32xx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/lpc32xx/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/lpc32xx/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -47,5 +47,5 @@
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/src/uart-output-char.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
Index: c/src/lib/libbsp/arm/raspberrypi/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/raspberrypi/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/raspberrypi/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -44,5 +44,5 @@
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-ttb-entries.c
Index: c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -45,5 +45,5 @@
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-exception-handler.c
Index: c/src/lib/libbsp/arm/stm32f4/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/stm32f4/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/stm32f4/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -38,5 +38,5 @@
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 
 # Startup
Index: c/src/lib/libbsp/arm/tms570/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/tms570/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/tms570/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -45,5 +45,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-exception-handler.c
Index: c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -43,5 +43,5 @@
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 librtemsbsp_a_SOURCES += ../shared/arm-cp15-set-exception-handler.c
Index: c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
===================================================================
--- c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -40,5 +40,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/bspgetworkarea.c
 
Index: c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
===================================================================
--- c/src/lib/libbsp/or1k/generic_or1k/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/or1k/generic_or1k/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -47,5 +47,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 
 # Console
Index: c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
===================================================================
--- c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -44,5 +44,5 @@
 librtemsbsp_a_SOURCES += ../../shared/bspclean.c
 librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/src/bsp-start-zero.S
 librtemsbsp_a_SOURCES += ../shared/src/memcpy.c
Index: c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
===================================================================
--- c/src/lib/libbsp/riscv/riscv_generic/Makefile.am	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ c/src/lib/libbsp/riscv/riscv_generic/Makefile.am	(revision 0a09ac58ac2844792dd496aa3c35ce692779d9bd)
@@ -41,5 +41,5 @@
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
-librtemsbsp_a_SOURCES += ../../shared/src/stackalloc.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/bspgetworkarea.c
 
Index: c/src/lib/libbsp/shared/src/stackalloc.c
===================================================================
--- c/src/lib/libbsp/shared/src/stackalloc.c	(revision 9d44ae78cf67f7fe1b22ecbd4f9d244f791758e6)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/**
- * @file
- *
- * @ingroup bsp_shared
- *
- * @brief Stack initialization, allocation and free functions.
- */
-
-/*
- * Copyright (c) 2009-2013 embedded brains GmbH.  All rights reserved.
- *
- *  embedded brains GmbH
- *  Obere Lagerstr. 30
- *  82178 Puchheim
- *  Germany
- *  <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include <bsp/stackalloc.h>
-
-#include <rtems.h>
-#include <rtems/score/heapimpl.h>
-#include <rtems/score/wkspace.h>
-
-#include <bsp/linker-symbols.h>
-
-static Heap_Control bsp_stack_heap;
-
-void bsp_stack_allocate_init(size_t stack_space_size)
-{
-  _Heap_Initialize(
-    &bsp_stack_heap,
-    bsp_section_stack_begin,
-    (uintptr_t) bsp_section_stack_size,
-    CPU_STACK_ALIGNMENT
-  );
-}
-
-void *bsp_stack_allocate(size_t size)
-{
-  void *stack = NULL;
-
-  if (bsp_stack_heap.area_begin != 0) {
-    stack = _Heap_Allocate(&bsp_stack_heap, size);
-  }
-
-  if (stack == NULL) {
-    stack = _Workspace_Allocate(size);
-  }
-
-  return stack;
-}
-
-void bsp_stack_free(void *stack)
-{
-  bool ok = _Heap_Free(&bsp_stack_heap, stack);
-
-  if (!ok) {
-    _Workspace_Free(stack);
-  }
-}
