source: rtems/c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_halt.c @ 866a6fc

4.115
Last change on this file since 866a6fc was 866a6fc, checked in by Sebastian Huber <sebastian.huber@…>, on 10/23/14 at 12:31:15

bsps/sparc: Include right header file

  • Property mode set to 100644
File size: 843 bytes
Line 
1/**
2 * @file
3 * @ingroup sparc_bsp
4 * @brief ERC32/LEON2 BSP Fatal_halt handler.
5 *
6 *  COPYRIGHT (c) 2014.
7 *  Aeroflex Gaisler AB.
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 <bsp.h>
15
16#ifdef BSP_POWER_DOWN_AT_FATAL_HALT
17
18/* Spin CPU on fatal error exit */
19void _CPU_Fatal_halt(uint32_t source, uint32_t error)
20{
21  uint32_t level = sparc_disable_interrupts();
22
23  __asm__ volatile ( "mov  %0, %%g1 " : "=r" (level) : "0" (level) );
24
25  while (1) ; /* loop forever */
26}
27
28#else
29
30/* return to debugger, simulator, hypervisor or similar by exiting
31 * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
32 */
33void _CPU_Fatal_halt(uint32_t source, uint32_t error)
34{
35  sparc_syscall_exit(source, error);
36}
37
38#endif
Note: See TracBrowser for help on using the repository browser.