diff options
Diffstat (limited to 'cpukit/score/cpu/nios2/nios2-fatal-halt.c')
-rw-r--r-- | cpukit/score/cpu/nios2/nios2-fatal-halt.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cpukit/score/cpu/nios2/nios2-fatal-halt.c b/cpukit/score/cpu/nios2/nios2-fatal-halt.c new file mode 100644 index 0000000000..319f6bdce1 --- /dev/null +++ b/cpukit/score/cpu/nios2/nios2-fatal-halt.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2011 embedded brains GmbH + * + * Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de) + * + * COPYRIGHT (c) 1989-2004. + * 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 <rtems/score/cpu.h> + +void _CPU_Fatal_halt( uint32_t _error ) +{ + /* write 0 to status register (disable interrupts) */ + __builtin_wrctl( 0, 0 ); + + /* write error code to ET register */ + __asm__ volatile ("mov et, %z0" : : "rM" (_error)); + + while (1); +} |