source: rtems/c/src/lib/libbsp/sparc/leon3/startup/bsp_fatal_halt.c @ 9bd7b3b1

4.115
Last change on this file since 9bd7b3b1 was 9bd7b3b1, checked in by Daniel Hellstrom <daniel@…>, on 05/20/14 at 15:45:07

SPARC: Fatal_halt use source and exit codes

The Fatal_halt handler now have two options, either halt
as before or enter system error state to return to
debugger or simulator. The exit-code is now also
propagated to the debugger which is very useful for
testing.

The CPU_Fatal_halt handler was split up into two, since
the only the LEON3 support the CPU power down.

The LEON3 halt now uses the power-down instruction to save
CPU power. This doesn't stop a potential watch-dog timer
from expiring.

  • Property mode set to 100644
File size: 787 bytes
Line 
1/**
2 * @file
3 * @ingroup sparc_leon3
4 * @brief LEON3 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 <leon.h>
15#include <rtems/score/sparc.h>
16
17#ifdef BSP_POWER_DOWN_AT_FATAL_HALT
18
19/* Power down LEON CPU on fatal error exit */
20void _CPU_Fatal_halt(uint32_t source, uint32_t error)
21{
22  sparc_disable_interrupts();
23  leon3_power_down_loop();
24}
25
26#else
27
28/* return to debugger, simulator, hypervisor or similar by exiting
29 * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
30 */
31void _CPU_Fatal_halt(uint32_t source, uint32_t error)
32{
33  sparc_syscall_exit(source, error);
34}
35
36#endif
Note: See TracBrowser for help on using the repository browser.