summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/nios2
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-06-04 11:23:34 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-10 14:06:08 +0200
commitf82752a474ee8157eafcb2f3192fb3ed8d3def9a (patch)
tree5aaa8ab0eb9676e90bf53ac15014c059ab93cc8b /cpukit/score/cpu/nios2
parentbsps/arm: Fix get cache size (diff)
downloadrtems-f82752a474ee8157eafcb2f3192fb3ed8d3def9a.tar.bz2
Let CPU/BSP Fatal handler have access to source
Without the source the error code does not say that much. Let it be up to the CPU/BSP to determine the error code reported on fatal shutdown. This patch does not change the current behaviour, just adds the option to handle the source of the fatal halt.
Diffstat (limited to 'cpukit/score/cpu/nios2')
-rw-r--r--cpukit/score/cpu/nios2/nios2-fatal-halt.c2
-rw-r--r--cpukit/score/cpu/nios2/nios2-iic-irq.c2
-rw-r--r--cpukit/score/cpu/nios2/rtems/score/cpu.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/score/cpu/nios2/nios2-fatal-halt.c b/cpukit/score/cpu/nios2/nios2-fatal-halt.c
index 7632fa52e0..40cae874c0 100644
--- a/cpukit/score/cpu/nios2/nios2-fatal-halt.c
+++ b/cpukit/score/cpu/nios2/nios2-fatal-halt.c
@@ -14,7 +14,7 @@
#include <rtems/score/cpu.h>
#include <rtems/score/nios2-utility.h>
-void _CPU_Fatal_halt( uint32_t _error )
+void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
{
/* write 0 to status register (disable interrupts) */
__builtin_wrctl( NIOS2_CTLREG_INDEX_STATUS, 0 );
diff --git a/cpukit/score/cpu/nios2/nios2-iic-irq.c b/cpukit/score/cpu/nios2/nios2-iic-irq.c
index 8f3f3b9348..f51bc2d2ce 100644
--- a/cpukit/score/cpu/nios2/nios2-iic-irq.c
+++ b/cpukit/score/cpu/nios2/nios2-iic-irq.c
@@ -133,5 +133,5 @@ void __ISR_Handler(void)
void __Exception_Handler(CPU_Exception_frame *efr)
{
- _CPU_Fatal_halt(0xECC0);
+ _CPU_Fatal_halt(RTEMS_FATAL_SOURCE_EXCEPTION, 0xECC0); /* source ignored */
}
diff --git a/cpukit/score/cpu/nios2/rtems/score/cpu.h b/cpukit/score/cpu/nios2/rtems/score/cpu.h
index fcfef8d461..a14392c821 100644
--- a/cpukit/score/cpu/nios2/rtems/score/cpu.h
+++ b/cpukit/score/cpu/nios2/rtems/score/cpu.h
@@ -310,7 +310,8 @@ void _CPU_Context_Initialize(
#define _CPU_Context_Restart_self( _the_context ) \
_CPU_Context_restore( (_the_context) );
-void _CPU_Fatal_halt( uint32_t _error ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
+void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
+ RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
/**
* @brief CPU initialization.