[rtems commit] bsps/stackalloc: Use stack section symbols

Sebastian Huber sebh at rtems.org
Tue Apr 24 12:32:28 UTC 2012


Module:    rtems
Branch:    master
Commit:    3c6d7ae543ec3831234d41f8e2d3d8f5315e4e57
Changeset: http://git.rtems.org/rtems/commit/?id=3c6d7ae543ec3831234d41f8e2d3d8f5315e4e57

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr 24 14:00:54 2012 +0200

bsps/stackalloc: Use stack section symbols

---

 c/src/lib/libbsp/arm/lpc24xx/configure.ac       |    4 ---
 c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c |    9 -------
 c/src/lib/libbsp/arm/lpc32xx/startup/bspstart.c |   19 ++++++----------
 c/src/lib/libbsp/shared/include/stackalloc.h    |   22 ++++++------------
 c/src/lib/libbsp/shared/src/stackalloc.c        |   27 ++++++++++------------
 5 files changed, 26 insertions(+), 55 deletions(-)

diff --git a/c/src/lib/libbsp/arm/lpc24xx/configure.ac b/c/src/lib/libbsp/arm/lpc24xx/configure.ac
index e2d23bc..9bdfc4c 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/configure.ac
+++ b/c/src/lib/libbsp/arm/lpc24xx/configure.ac
@@ -77,10 +77,6 @@ RTEMS_BSPOPTS_HELP([LPC24XX_EMC_SST39VF3201],[enable SST39VF3201 configuration f
 RTEMS_BSPOPTS_SET([LPC24XX_EMC_TEST],[*],[])
 RTEMS_BSPOPTS_HELP([LPC24XX_EMC_TEST],[enable tests for EMC])
 
-RTEMS_BSPOPTS_SET([LPC24XX_SPECIAL_TASK_STACKS_SUPPORT],[lpc23*],[])
-RTEMS_BSPOPTS_SET([LPC24XX_SPECIAL_TASK_STACKS_SUPPORT],[*],[1])
-RTEMS_BSPOPTS_HELP([LPC24XX_SPECIAL_TASK_STACKS_SUPPORT],[enable special task stack support for task stacks in internal RAM])
-
 RTEMS_BSPOPTS_SET([LPC24XX_CONFIG_CONSOLE],[*],[0])
 RTEMS_BSPOPTS_HELP([LPC24XX_CONFIG_CONSOLE],[configuration for console (UART 0)])
 
diff --git a/c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c b/c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c
index 905336b..a68e6b8 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c
@@ -28,7 +28,6 @@
 #include <bsp/irq.h>
 #include <bsp/linker-symbols.h>
 #include <bsp/lpc24xx.h>
-#include <bsp/stackalloc.h>
 #include <bsp/system-clocks.h>
 #include <bsp/uart-output-char.h>
 
@@ -94,12 +93,4 @@ void bsp_start(void)
 
   /* DMA */
   lpc24xx_dma_initialize();
-
-  /* Task stacks */
-  #ifdef LPC24XX_SPECIAL_TASK_STACKS_SUPPORT
-    bsp_stack_initialize(
-      bsp_section_stack_begin,
-      (uintptr_t) bsp_section_stack_size
-    );
-  #endif
 }
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstart.c b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstart.c
index c685e27..ec900a5 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstart.c
@@ -7,12 +7,13 @@
  */
 
 /*
- * Copyright (c) 2009, 2010
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems at embedded-brains.de>
+ * Copyright (c) 2009-2012 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -24,7 +25,6 @@
 #include <bsp/irq-generic.h>
 #include <bsp/irq.h>
 #include <bsp/linker-symbols.h>
-#include <bsp/stackalloc.h>
 #include <bsp/lpc32xx.h>
 
 void bsp_start(void)
@@ -32,9 +32,4 @@ void bsp_start(void)
   if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
     _CPU_Fatal_halt(0xe);
   }
-
-  bsp_stack_initialize(
-    bsp_section_stack_begin,
-    (uintptr_t) bsp_section_stack_size
-  );
 }
diff --git a/c/src/lib/libbsp/shared/include/stackalloc.h b/c/src/lib/libbsp/shared/include/stackalloc.h
index 9462ed5..b8516ef 100644
--- a/c/src/lib/libbsp/shared/include/stackalloc.h
+++ b/c/src/lib/libbsp/shared/include/stackalloc.h
@@ -7,12 +7,13 @@
  */
 
 /*
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * rtems at embedded-brains.de
+ * Copyright (c) 2009-2012 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -51,15 +52,6 @@ extern "C" {
  */
 
 /**
- * @brief Task stack management initialization.
- *
- * This function should be called in bsp_start() with the designated task stack
- * area begin address @a begin and task stack area size @a size in bytes.  The
- * area boundaries have to be aligned properly.
- */
-void bsp_stack_initialize(void *begin, uintptr_t size);
-
-/**
  * @brief Task stack allocator for @ref CONFIGURE_TASK_STACK_ALLOCATOR.
  *
  * In case the designated task stack space from bsp_stack_initialize() is
diff --git a/c/src/lib/libbsp/shared/src/stackalloc.c b/c/src/lib/libbsp/shared/src/stackalloc.c
index e6145d5..be84057 100644
--- a/c/src/lib/libbsp/shared/src/stackalloc.c
+++ b/c/src/lib/libbsp/shared/src/stackalloc.c
@@ -7,22 +7,25 @@
  */
 
 /*
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * rtems at embedded-brains.de
+ * Copyright (c) 2009-2012 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at 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.com/license/LICENSE.
  */
 
+#include <bsp/stackalloc.h>
+
 #include <rtems.h>
 #include <rtems/score/wkspace.h>
 
-#include <bsp/stackalloc.h>
+#include <bsp/linker-symbols.h>
 
 #define BSP_STACK_MAGIC 0xdeadbeef
 
@@ -30,12 +33,6 @@ static Heap_Control bsp_stack_heap = {
   .page_size = BSP_STACK_MAGIC
 };
 
-void bsp_stack_initialize(void *begin, uintptr_t size)
-{
-  bsp_stack_heap.area_begin = (uintptr_t) begin;
-  bsp_stack_heap.area_end = size;
-}
-
 void *bsp_stack_allocate(size_t size)
 {
   void *stack = NULL;
@@ -43,8 +40,8 @@ void *bsp_stack_allocate(size_t size)
   if (bsp_stack_heap.page_size == BSP_STACK_MAGIC) {
     uintptr_t rv = _Heap_Initialize(
       &bsp_stack_heap,
-      (void *) bsp_stack_heap.area_begin,
-      bsp_stack_heap.area_end,
+      bsp_section_stack_begin,
+      (uintptr_t) bsp_section_stack_size,
       CPU_STACK_ALIGNMENT
     );
     if (rv == 0) {




More information about the vc mailing list