summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 16:13:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-19 16:13:01 +0000
commitb181c306072b5318f1548913c71470df5b992aa4 (patch)
tree0a39631d33e4ccc68ecf883545e842862d4b538f /c
parent2009-08-19 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-b181c306072b5318f1548913c71470df5b992aa4.tar.bz2
2009-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, include/bsp.h, startup/setvec.c: Split idle method into its own file. Properly note to confdefs.h that this BSP has its own idle thread. * startup/bspidle.c: New file.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/sparc/leon2/ChangeLog7
-rw-r--r--c/src/lib/libbsp/sparc/leon2/Makefile.am2
-rw-r--r--c/src/lib/libbsp/sparc/leon2/include/bsp.h26
-rw-r--r--c/src/lib/libbsp/sparc/leon2/startup/bspidle.c31
-rw-r--r--c/src/lib/libbsp/sparc/leon2/startup/setvec.c10
5 files changed, 53 insertions, 23 deletions
diff --git a/c/src/lib/libbsp/sparc/leon2/ChangeLog b/c/src/lib/libbsp/sparc/leon2/ChangeLog
index d32be60b33..874f7dcb2c 100644
--- a/c/src/lib/libbsp/sparc/leon2/ChangeLog
+++ b/c/src/lib/libbsp/sparc/leon2/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, include/bsp.h, startup/setvec.c: Split idle method into
+ its own file. Properly note to confdefs.h that this BSP has its own
+ idle thread.
+ * startup/bspidle.c: New file.
+
2009-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* cchip/cchip.c, include/cchip.h, include/rasta.h, pci/pci.c: Add CVS
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index b07720446d..510e376e3e 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -58,7 +58,7 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bsppredriverhook.c \
../../sparc/shared/bspgetworkarea.c ../../sparc/shared/bspstart.c \
../../shared/bootcard.c ../../shared/sbrk.c startup/setvec.c \
- startup/spurious.c
+ startup/spurious.c startup/bspidle.c
# gnatsupp
libbsp_a_SOURCES += gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
# console
diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
index 2de979ea62..f35b499e9f 100644
--- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
@@ -37,23 +37,26 @@ extern "C" {
#define LEON2 1
/*
- * confdefs.h overrides for this BSP:
- * - two termios serial ports
- * - Interrupt stack space is not minimum if defined.
+ * BSP provides its own Idle thread body
*/
-
-#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
+void *bsp_idle_thread( uintptr_t ignored );
+#define BSP_IDLE_TASK_BODY bsp_idle_thread
/*
* Network driver configuration
*/
-
struct rtems_bsdnet_ifconfig;
-extern int rtems_leon_open_eth_driver_attach (struct rtems_bsdnet_ifconfig *config);
-extern int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config);
+extern int rtems_leon_open_eth_driver_attach(
+ struct rtems_bsdnet_ifconfig *config
+);
+extern int rtems_smc91111_driver_attach_leon2(
+ struct rtems_bsdnet_ifconfig *config
+);
#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
-#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH rtems_leon_open_eth_driver_attach
-#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 rtems_smc91111_driver_attach_leon2
+#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
+ rtems_leon_open_eth_driver_attach
+#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
+ rtems_smc91111_driver_attach_leon2
/*
* The synchronous trap is an arbitrarily chosen software trap.
@@ -63,12 +66,11 @@ extern int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *conf
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
*/
-
extern void Clock_delay(uint32_t microseconds);
#define delay( microseconds ) Clock_delay(microseconds)
-extern int CPU_SPARC_HAS_SNOOPING;
+extern int CPU_SPARC_HAS_SNOOPING;
/* Constants */
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/bspidle.c b/c/src/lib/libbsp/sparc/leon2/startup/bspidle.c
new file mode 100644
index 0000000000..34365be8ff
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/leon2/startup/bspidle.c
@@ -0,0 +1,31 @@
+/*
+ * LEON2 Idle Thread with power-down function
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * 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.
+ *
+ * Ported to LEON implementation of the SPARC by On-Line Applications
+ * Research Corporation (OAR) under contract to the European Space
+ * Agency (ESA).
+ *
+ * LEON modifications of respective RTEMS file: COPYRIGHT (c) 1995.
+ * European Space Agency.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+
+void *bsp_idle_thread( uintptr_t ignored )
+{
+ while (1) {
+ /* make sure on load follows store to power-down reg */
+ LEON_REG.Power_Down = LEON_REG.Power_Down;
+ }
+ return NULL;
+}
+
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
index 2f17de097a..b48b3e050d 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
@@ -59,13 +59,3 @@ rtems_isr_entry set_vector( /* returns old vector */
return previous_isr;
}
-
-/* LEON specific power-down function */
-
-void _CPU_Thread_Idle_body( void )
-{
- while (1) {
- LEON_REG.Power_Down = LEON_REG.Power_Down; /* make sure on load follows store to power-down reg */
- }
-}
-