summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-04-24 14:00:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-04-24 14:35:16 +0200
commit3c6d7ae543ec3831234d41f8e2d3d8f5315e4e57 (patch)
tree6e8e60a82b479698eeef4b664e3142903b8f5a4a /c/src/lib/libbsp/shared
parentbsps/powerpc: Add no cache section (diff)
downloadrtems-3c6d7ae543ec3831234d41f8e2d3d8f5315e4e57.tar.bz2
bsps/stackalloc: Use stack section symbols
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r--c/src/lib/libbsp/shared/include/stackalloc.h22
-rw-r--r--c/src/lib/libbsp/shared/src/stackalloc.c27
2 files changed, 19 insertions, 30 deletions
diff --git a/c/src/lib/libbsp/shared/include/stackalloc.h b/c/src/lib/libbsp/shared/include/stackalloc.h
index 9462ed5f2a..b8516ef85f 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@embedded-brains.de
+ * Copyright (c) 2009-2012 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
@@ -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 e6145d5873..be84057aae 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@embedded-brains.de
+ * Copyright (c) 2009-2012 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.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) {