summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-15 19:18:45 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-15 19:18:45 +0000
commit5e8726d0c84b23b5cf09060dc04ddca11b9bbda1 (patch)
treeec5c08418aeafb4ec1dff1bcceeac74c6be51904
parent2008-09-15 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-5e8726d0c84b23b5cf09060dc04ddca11b9bbda1.tar.bz2
2008-09-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/bspgetworkarea.c, shared/bsphwinit.c, shared/bspstart.c: New files.
-rw-r--r--c/src/lib/libbsp/sh/ChangeLog5
-rw-r--r--c/src/lib/libbsp/sh/shared/bspgetworkarea.c39
-rw-r--r--c/src/lib/libbsp/sh/shared/bsphwinit.c16
-rw-r--r--c/src/lib/libbsp/sh/shared/bspstart.c64
4 files changed, 124 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sh/ChangeLog b/c/src/lib/libbsp/sh/ChangeLog
index ffbdf81148..86ac21978e 100644
--- a/c/src/lib/libbsp/sh/ChangeLog
+++ b/c/src/lib/libbsp/sh/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-15 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * shared/bspgetworkarea.c, shared/bsphwinit.c, shared/bspstart.c:
+ New files.
+
2007-04-17 Joel Sherrill <joel@OARcorp.com>
* simsh4/tools/runtest.in: Do not run pppd.exe from batch mode script.
diff --git a/c/src/lib/libbsp/sh/shared/bspgetworkarea.c b/c/src/lib/libbsp/sh/shared/bspgetworkarea.c
new file mode 100644
index 0000000000..e8c464a1da
--- /dev/null
+++ b/c/src/lib/libbsp/sh/shared/bspgetworkarea.c
@@ -0,0 +1,39 @@
+/*
+ * 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>
+
+extern void *RamBase;
+extern void *RamSize;
+extern void *WorkSpaceStart;
+
+/*
+ * 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
+)
+{
+ uintptr_t size;
+
+ size = (uintptr_t)&RamBase + (uintptr_t)&RamSize
+ - (uintptr_t)&WorkSpaceStart;
+
+ *work_area_start = (void *)&WorkSpaceStart;
+ *work_area_size = size;
+ *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
+ *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
+}
+
diff --git a/c/src/lib/libbsp/sh/shared/bsphwinit.c b/c/src/lib/libbsp/sh/shared/bsphwinit.c
new file mode 100644
index 0000000000..fd17dc3e7e
--- /dev/null
+++ b/c/src/lib/libbsp/sh/shared/bsphwinit.c
@@ -0,0 +1,16 @@
+/*
+ * This is a dummy bsp_hw_init routine.
+ *
+ * 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$
+ */
+
+void bsp_hw_init( void )
+{
+}
diff --git a/c/src/lib/libbsp/sh/shared/bspstart.c b/c/src/lib/libbsp/sh/shared/bspstart.c
new file mode 100644
index 0000000000..8fa18717c6
--- /dev/null
+++ b/c/src/lib/libbsp/sh/shared/bspstart.c
@@ -0,0 +1,64 @@
+/*
+ * This routine starts the application. It includes application,
+ * board, and monitor specific initialization and configuration.
+ * The generic CPU dependent initialization has been performed
+ * before this routine is invoked.
+ *
+ * COPYRIGHT (c) 2001.
+ * Ralf Corsepius (corsepiu@faw.uni-ulm.de).
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * COPYRIGHT (c) 2001.
+ * 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>
+
+uint32_t bsp_clicks_per_second;
+
+#ifndef START_HW_INIT
+ void bsp_hw_init(void);
+#endif
+
+/*
+ * bsp_start
+ *
+ * This routine does the bulk of the system initialization.
+ */
+void bsp_start( void )
+{
+ /*
+ * For real boards you need to setup the hardware
+ * and need to copy the vector table from rom to ram.
+ *
+ * Depending on the board this can either be done from inside the rom
+ * startup code, rtems startup code or here.
+ */
+
+ #ifndef START_HW_INIT
+ /* board hardware setup here, or from 'start.S' */
+ bsp_hw_init();
+ #endif
+
+ /*
+ * initialize the interrupt stack for this BSP
+ */
+ #if ( CPU_ALLOCATE_INTERRUPT_STACK == FALSE )
+ _CPU_Interrupt_stack_low = &CPU_Interrupt_stack_low ;
+ _CPU_Interrupt_stack_high = &CPU_Interrupt_stack_high ;
+ #endif
+
+ /*
+ * initialize the device driver parameters
+ */
+ bsp_clicks_per_second = CPU_CLOCK_RATE_HZ;
+}