summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-15 15:52:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-15 15:52:15 +0000
commit621feee0620f8b1a037d2b7118013a75f1ca6508 (patch)
treecc52b6f777cd9feaef97a97563a1a49aa48ef123 /c
parent2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-621feee0620f8b1a037d2b7118013a75f1ca6508.tar.bz2
2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/m68kpretaskinghook.c: Add capability for bootcard.c BSP Initialization Framework to ask the BSP where it has memory for the RTEMS Workspace and C Program Heap. These collectively are referred to as work area. If the BSP supports this, then it does not have to include code to split the available memory between the two areas. This reduces the amount of code in the BSP specific bspstart.c file. Additionally, the shared framework can dirty the work area memory. Until most/all BSPs support this new capability, if the BSP supports this, it should call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When the transition is complete, this autoconf macro can be removed. * shared/m68kbspgetworkarea.c: New file.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/m68k/ChangeLog15
-rw-r--r--c/src/lib/libbsp/m68k/shared/m68kbspgetworkarea.c38
-rw-r--r--c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c5
3 files changed, 53 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/m68k/ChangeLog b/c/src/lib/libbsp/m68k/ChangeLog
index 91fcd6a2b3..2fa27436d2 100644
--- a/c/src/lib/libbsp/m68k/ChangeLog
+++ b/c/src/lib/libbsp/m68k/ChangeLog
@@ -1,3 +1,18 @@
+2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * shared/m68kpretaskinghook.c: Add capability for bootcard.c BSP
+ Initialization Framework to ask the BSP where it has memory for the
+ RTEMS Workspace and C Program Heap. These collectively are referred
+ to as work area. If the BSP supports this, then it does not have to
+ include code to split the available memory between the two areas.
+ This reduces the amount of code in the BSP specific bspstart.c file.
+ Additionally, the shared framework can dirty the work area memory.
+ Until most/all BSPs support this new capability, if the BSP supports
+ this, it should call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from
+ its configure.ac. When the transition is complete, this autoconf
+ macro can be removed.
+ * shared/m68kbspgetworkarea.c: New file.
+
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/m68kpretaskinghook.c: Eliminate copies of the Configuration
diff --git a/c/src/lib/libbsp/m68k/shared/m68kbspgetworkarea.c b/c/src/lib/libbsp/m68k/shared/m68kbspgetworkarea.c
new file mode 100644
index 0000000000..fbcd7c557d
--- /dev/null
+++ b/c/src/lib/libbsp/m68k/shared/m68kbspgetworkarea.c
@@ -0,0 +1,38 @@
+/*
+ * This routine is an implementation of the bsp_get_workarea()
+ * that can be used by all m68k BSPs following linkcmds conventions
+ * regarding heap, stack, and workspace allocation.
+ *
+ * COPYRIGHT (c) 1989-2008.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+
+/*
+ * This method returns the base address and size of the area which
+ * is to be allocated between the RTEMS Workspace and the C Program
+ * Heap.
+ */
+void bsp_get_workarea(
+ void **workarea_base,
+ size_t *workarea_size,
+ size_t *requested_heap_size
+)
+{
+ extern char _RamBase[];
+ extern char _WorkspaceBase[];
+ extern char _HeapSize[];
+ extern void *_RamSize;
+
+ *workarea_base = _WorkspaceBase;
+ *workarea_size = (unsigned long)_RamBase + (unsigned long) _RamSize -
+ (unsigned long)_WorkspaceBase;
+ *requested_heap_size = (size_t) _HeapSize;
+}
diff --git a/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c b/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c
index e0bd54f31a..6bfdbb59eb 100644
--- a/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c
+++ b/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c
@@ -59,9 +59,4 @@ void bsp_pretasking_hook(void)
rtems_fatal_error_occurred (('H'<<24) | ('E'<<16) | ('A'<<8) | 'P');
bsp_libc_init(heapStart, heapSize, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-
}