summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-15 19:25:42 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-15 19:25:42 +0000
commit379a47617205a78f034b4f01dcb1321ad306ad83 (patch)
tree2a985a266fbc3e2067552ef2625202a391b7dc7a /c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
parent2008-09-15 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-379a47617205a78f034b4f01dcb1321ad306ad83.tar.bz2
2008-09-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, startup/bspstart.c: Use shared bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization. * startup/bspgetworkarea.c: New file.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
new file mode 100644
index 0000000000..591ed811ef
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
@@ -0,0 +1,42 @@
+/*
+ * 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>
+#include <bsp/bootcard.h>
+#include <stdint.h>
+
+#if defined(HAS_UBOOT)
+ extern bd_t *uboot_bdinfo_ptr;
+#endif
+
+/*
+ * 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_work_area(
+ void **work_area_start,
+ size_t *work_area_size,
+ void **heap_start,
+ size_t *heap_size
+)
+{
+ #ifdef HAS_UBOOT
+ char *ram_end = (char *) uboot_bdinfo_ptr->bi_memstart +
+ uboot_bdinfo_ptr->bi_memsize;
+ #else /* HAS_UBOOT */
+ char *ram_end = bsp_ram_end;
+ #endif /* HAS_UBOOT */
+
+ *work_area_start = bsp_work_area_start;
+ *work_area_size = ram_end - bsp_work_area_start;
+ *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
+ *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
+}
+