summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/start
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-05-19 17:27:55 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2014-10-06 09:34:24 +0200
commitce4a7ae9da4c0999ac3ff90603e8198f136171b5 (patch)
treec7ee8bd590f355f5728579d5cf6337664262f6f4 /c/src/lib/libbsp/sparc/shared/start
parentSPARC BSPs: remove BSP_fatal_return unreached code (diff)
downloadrtems-ce4a7ae9da4c0999ac3ff90603e8198f136171b5.tar.bz2
SPARC: add BSP specific error handler
Instead of calling the system call TA instruction directly it is better paractise to isolate the trap implementation to the system call functions. BSP_fatal_exit() is added.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/shared/start/start.S5
-rw-r--r--c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c19
2 files changed, 21 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S
index e621c39d93..8f10000594 100644
--- a/c/src/lib/libbsp/sparc/shared/start/start.S
+++ b/c/src/lib/libbsp/sparc/shared/start/start.S
@@ -368,9 +368,8 @@ zerobss:
#if !defined(START_LEON3_ENABLE_SMP)
PUBLIC(bsp_reset)
SYM(bsp_reset):
- mov 1, %g1
- ta 0 ! Halt if _main returns ...
- nop
+ call SYM(BSP_fatal_exit)
+ clr %o0
#endif
/* end of file */
diff --git a/c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c b/c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c
new file mode 100644
index 0000000000..c7ba6c2b87
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c
@@ -0,0 +1,19 @@
+/**
+ * @file
+ * @ingroup sparc_bsp
+ * @brief ERC32/LEON2/LEON3 BSP specific exit handler.
+ *
+ * COPYRIGHT (c) 2014.
+ * Aeroflex Gaisler AB.
+ *
+ * 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>
+
+void BSP_fatal_exit(uint32_t error)
+{
+ sparc_syscall_exit(RTEMS_FATAL_SOURCE_BSP, error);
+}