[rtems commit] raspberrypi: Use shared bspreset.c

Joel Sherrill joel at rtems.org
Thu Sep 4 13:59:24 UTC 2014


Module:    rtems
Branch:    master
Commit:    be4992b1932b098271ff7bd1141b5265f450f8b1
Changeset: http://git.rtems.org/rtems/commit/?id=be4992b1932b098271ff7bd1141b5265f450f8b1

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Tue Sep  2 18:00:44 2014 -0500

raspberrypi: Use shared bspreset.c

---

 c/src/lib/libbsp/arm/csb337/startup/bspreset.c     |    1 +
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am       |    2 +-
 .../lib/libbsp/arm/raspberrypi/startup/bspreset.c  |   35 -----------
 testsuites/sptests/spintr_err01/init.c             |   65 ++++++++++----------
 4 files changed, 34 insertions(+), 69 deletions(-)

diff --git a/c/src/lib/libbsp/arm/csb337/startup/bspreset.c b/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
index 1167d92..940ff7f 100644
--- a/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
+++ b/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
@@ -17,6 +17,7 @@ void bsp_reset(void)
 {
   rtems_interrupt_level level;
 
+  (void) level;
   rtems_interrupt_disable(level);
 
   /* Enable the watchdog timer, then wait for the world to end. */
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index a8d98b4..cda8510 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -92,7 +92,7 @@ libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
 libbsp_a_SOURCES += ../shared/arm-cp15-set-ttb-entries.c
 
 # Startup
-libbsp_a_SOURCES += startup/bspreset.c
+libbsp_a_SOURCES += ../../shared/bspreset_loop.c
 libbsp_a_SOURCES += startup/bspstart.c
 
 # IRQ
diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/bspreset.c b/c/src/lib/libbsp/arm/raspberrypi/startup/bspreset.c
deleted file mode 100644
index 4b3c732..0000000
--- a/c/src/lib/libbsp/arm/raspberrypi/startup/bspreset.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @file
- *
- * @ingroup arm_start
- *
- * @brief Raspberry Pi reset code.
- */
-
-/*
- * Copyright (c) 2013 by Alan Cudmore
- * Based on work by:
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems at embedded-brains.de>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *
- *  http://www.rtems.org/license/LICENSE
- *
- */
-
-#include <rtems.h>
-
-#include <bsp/bootcard.h>
-
-void bsp_reset( void)
-{
-  while (true) {
-    /* Do nothing */
-  }
-}
diff --git a/testsuites/sptests/spintr_err01/init.c b/testsuites/sptests/spintr_err01/init.c
index 84ebfdb..490a0e6 100644
--- a/testsuites/sptests/spintr_err01/init.c
+++ b/testsuites/sptests/spintr_err01/init.c
@@ -20,11 +20,8 @@ rtems_task Init(
   rtems_task_argument argument
 )
 {
-  rtems_status_code status;
-
   TEST_BEGIN();
-  #if ((CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE) || \
-       defined(_C3x) || defined(_C4x))
+  #if (CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE)
     puts(
       "TA1 - rtems_interrupt_catch - "
       "bad handler RTEMS_INVALID_ADDRESS -- SKIPPED"
@@ -32,36 +29,38 @@ rtems_task Init(
     puts(
       "TA1 - rtems_interrupt_catch - "
       "old isr RTEMS_INVALID_ADDRESS - SKIPPED" );
-#else
-  rtems_isr_entry   old_service_routine;
-    status = rtems_interrupt_catch(
-      Service_routine,
-      CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 1,
-      &old_service_routine
-    );
-    fatal_directive_status(
-      status,
-      RTEMS_INVALID_NUMBER,
-      "rtems_interrupt_catch with invalid vector"
-    );
-    puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" );
+  #else
+    rtems_status_code status;
 
-    status = rtems_interrupt_catch( NULL, 3, &old_service_routine );
-    fatal_directive_status(
-      status,
-      RTEMS_INVALID_ADDRESS,
-      "rtems_interrupt_catch with invalid handler"
-    );
-    puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS" );
+    rtems_isr_entry   old_service_routine;
+      status = rtems_interrupt_catch(
+        Service_routine,
+        CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 1,
+        &old_service_routine
+      );
+      fatal_directive_status(
+        status,
+        RTEMS_INVALID_NUMBER,
+        "rtems_interrupt_catch with invalid vector"
+      );
+      puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" );
+
+      status = rtems_interrupt_catch( NULL, 3, &old_service_routine );
+      fatal_directive_status(
+        status,
+        RTEMS_INVALID_ADDRESS,
+        "rtems_interrupt_catch with invalid handler"
+      );
+      puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS" );
+
+      status = rtems_interrupt_catch( Service_routine, 3, NULL );
+      fatal_directive_status(
+        status,
+        RTEMS_INVALID_ADDRESS,
+        "rtems_interrupt_catch with invalid old isr pointer"
+      );
+      puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" );
+  #endif
 
-    status = rtems_interrupt_catch( Service_routine, 3, NULL );
-    fatal_directive_status(
-      status,
-      RTEMS_INVALID_ADDRESS,
-      "rtems_interrupt_catch with invalid old isr pointer"
-    );
-    puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" );
-#endif
- 
   TEST_END();
 }



More information about the vc mailing list