source: rtems/cpukit/score/cpu/nios2/nios2-fatal-halt.c @ 8b65b574

Last change on this file since 8b65b574 was 8b65b574, checked in by Sebastian Huber <sebastian.huber@…>, on 07/28/21 at 12:41:32

score: Canonicalize _CPU_Fatal_halt()

Move _CPU_Fatal_halt() declaration to <rtems/score/cpuimpl.h> and make sure it
is a proper declaration of a function which does not return. Fix the type of
the error code. If necessary, add the implementation to cpu.c. Implementing
_CPU_Fatal_halt() as a function makes it possible to wrap this function for
example to fully test _Terminate().

  • Property mode set to 100644
File size: 712 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/cpuimpl.h>
15#include <rtems/score/nios2-utility.h>
16
17void _CPU_Fatal_halt( uint32_t _source, CPU_Uint32ptr _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.