summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-19 20:40:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-19 20:40:17 +0000
commitaf2eb770c7eea77967c19876ba907bd5a46176ec (patch)
treee8079c519db13718a31d66b01ec4600cf256d083 /c/src/lib/libbsp
parent2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-af2eb770c7eea77967c19876ba907bd5a46176ec.tar.bz2
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, include/bsp.h, startup/bspstart.c, startup/linkcmds: Use PowerPC level shared bsp_get_work_area() implementation. * startup/bspgetworkarea.c: Removed.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/powerpc/psim/ChangeLog6
-rw-r--r--c/src/lib/libbsp/powerpc/psim/Makefile.am4
-rw-r--r--c/src/lib/libbsp/powerpc/psim/include/bsp.h9
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c43
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspstart.c13
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/linkcmds10
6 files changed, 32 insertions, 53 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/ChangeLog b/c/src/lib/libbsp/powerpc/psim/ChangeLog
index 026ccc9fac..a3744d8099 100644
--- a/c/src/lib/libbsp/powerpc/psim/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/psim/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, include/bsp.h, startup/bspstart.c, startup/linkcmds: Use
+ PowerPC level shared bsp_get_work_area() implementation.
+ * startup/bspgetworkarea.c: Removed.
+
2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Remove unnecessary boilerplate comments.
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am
index dd17a9ef4a..b47ea874ea 100644
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am
@@ -43,8 +43,8 @@ noinst_LIBRARIES = libbsp.a
startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bsppretaskinghook.c \
../../shared/bsppredriverhook.c startup/bspstart.c \
- startup/bspgetworkarea.c ../../shared/bootcard.c \
- ../../shared/sbrk.c ../../shared/gnatinstallhandler.c \
+ ../../powerpc/shared/startup/bspgetworkarea.c ../../shared/bootcard.c \
+ ../../powerpc/shared/startup/sbrk.c ../../shared/gnatinstallhandler.c \
startup/psim_registers.c
pclock_SOURCES = ../shared/clock/p_clock.c
diff --git a/c/src/lib/libbsp/powerpc/psim/include/bsp.h b/c/src/lib/libbsp/powerpc/psim/include/bsp.h
index ef23d51812..6e98b90997 100644
--- a/c/src/lib/libbsp/powerpc/psim/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/psim/include/bsp.h
@@ -56,8 +56,15 @@ extern "C" {
* Information placed in the linkcmds file.
*/
-extern int RAM_END;
extern int end; /* last address in the program */
+extern int RAM_END;
+
+extern uint32_t BSP_mem_size;
+
+/*
+ * system init stack
+ */
+#define BSP_INIT_STACK_SIZE 0x1000
#define BSP_Convert_decrementer( _value ) ( (unsigned long long) _value )
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c
deleted file mode 100644
index 76bd79918d..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * This set of routines starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before any of these are invoked.
- *
- * 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 <string.h>
-#include <fcntl.h>
-#include <bsp.h>
-#include <bsp/bootcard.h>
-
-/*
- * system init stack
- */
-#define INIT_STACK_SIZE 0x1000
-
-/*
- * 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
-)
-{
- *work_area_start = &end;
- *work_area_size = (void *)&RAM_END - (void *)&end;
- *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
- *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
index 592a6e7703..22d207be68 100644
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
@@ -43,14 +43,15 @@ extern int PSIM_INSTRUCTIONS_PER_MICROSECOND;
unsigned int BSP_bus_frequency;
/*
- * Time base divisior (how many tick for 1 second).
+ * Memory on this board.
*/
-unsigned int BSP_time_base_divisor;
+extern char RamSize[];
+uint32_t BSP_mem_size;
/*
- * system init stack
+ * Time base divisior (how many tick for 1 second).
*/
-#define INIT_STACK_SIZE 0x1000
+unsigned int BSP_time_base_divisor;
void BSP_panic(char *s)
{
@@ -97,9 +98,11 @@ void bsp_start( void )
/*
* Initialize the interrupt related settings.
*/
- intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
+ intrStackStart = (uint32_t) __rtems_end;
intrStackSize = rtems_configuration_get_interrupt_stack_size();
+ BSP_mem_size = RamSize;
+
/*
* Initialize default raw exception handlers.
*/
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
index 42f052798f..2c3f89130d 100644
--- a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
@@ -15,6 +15,10 @@ ENTRY(_start)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000);
+
+RamBase = DEFINED(RamBase) ? RamBase : 0x0;
+RamSize = DEFINED(RamSize) ? RamSize : 8M;
+
MEMORY
{
RAM : ORIGIN = 0, LENGTH = 8M
@@ -200,7 +204,7 @@ _SDA_BASE_ = __SDATA_START__ + 0x8000;
_edata = .;
PROVIDE (edata = .);
- PROVIDE (RAM_END = 0x7f0000);
+ PROVIDE (RAM_END = 8M);
.sbss :
{
PROVIDE (__sbss_start = .);
@@ -217,9 +221,11 @@ _SDA_BASE_ = __SDATA_START__ + 0x8000;
*(.bss .bss* .gnu.linkonce.b*)
*(COMMON)
} >RAM
+ . = ALIGN(16);
+ . += 0x1000;
+ PROVIDE(__stack = .);
__rtems_end = . ;
. = ALIGN(8) + 0x8000;
- PROVIDE(__stack = .);
PROVIDE(_end = .);
PROVIDE(end = .);