source: rtems/cpukit/score/cpu/nios2/nios2-fatal-halt.c @ 2afb22b

5
Last change on this file since 2afb22b was f82752a4, checked in by Daniel Hellstrom <daniel@…>, on 06/04/14 at 09:23:34

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.

  • Property mode set to 100644
File size: 703 bytes
Line 
1/*
2 *  Copyright (c) 2011 embedded brains GmbH
3 *
4 *  Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de)
5 *
6 *  COPYRIGHT (c) 1989-2004.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.org/license/LICENSE.
12 */
13
14#include <rtems/score/cpu.h>
15#include <rtems/score/nios2-utility.h>
16
17void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
18{
19  /* write 0 to status register (disable interrupts) */
20  __builtin_wrctl( NIOS2_CTLREG_INDEX_STATUS, 0 );
21
22  /* write error code to ET register */
23  __asm__ volatile ("mov et, %z0" : : "rM" (_error));
24
25  while (1);
26}
Note: See TracBrowser for help on using the repository browser.