SPARC: add BSP specific error handler

Instead of calling the system call TA instruction directly it
is better paractise to isolate the trap implementation to the
system call functions.

BSP_fatal_exit() is added.
This commit is contained in:
Daniel Hellstrom
2014-05-19 17:27:55 +02:00
parent dfc2786d4d
commit ce4a7ae9da
8 changed files with 30 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ libbsp_a_SOURCES += startup/boardinit.S
libbsp_a_SOURCES += startup/bspidle.c
libbsp_a_SOURCES += startup/bspdelay.c
libbsp_a_SOURCES += ../../sparc/shared/startup/early_malloc.c
libbsp_a_SOURCES += ../../sparc/shared/startup/bsp_fatal_exit.c
# ISR Handler
libbsp_a_SOURCES += ../../sparc/shared/cpu.c
libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S

View File

@@ -92,6 +92,8 @@ rtems_isr_entry set_vector( /* returns old vector */
int type /* RTEMS or RAW intr */
);
void BSP_fatal_exit(uint32_t error);
void bsp_spurious_initialize( void );
/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function

View File

@@ -60,6 +60,7 @@ libbsp_a_SOURCES += startup/bspidle.c
libbsp_a_SOURCES += ../../shared/bspinit.c
libbsp_a_SOURCES += startup/bspdelay.c
libbsp_a_SOURCES += ../../sparc/shared/startup/early_malloc.c
libbsp_a_SOURCES += ../../sparc/shared/startup/bsp_fatal_exit.c
# ISR Handler
libbsp_a_SOURCES += ../../sparc/shared/cpu.c

View File

@@ -113,6 +113,8 @@ rtems_isr_entry set_vector( /* returns old vector */
int type /* RTEMS or RAW intr */
);
void BSP_fatal_exit(uint32_t error);
void bsp_spurious_initialize( void );
/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function

View File

@@ -41,6 +41,7 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bspinit.c ../../sparc/shared/startup/early_malloc.c
libbsp_a_SOURCES += startup/bspreset.c
libbsp_a_SOURCES += startup/cpucounter.c
libbsp_a_SOURCES += ../../sparc/shared/startup/bsp_fatal_exit.c
# ISR Handler
libbsp_a_SOURCES += ../../sparc/shared/cpu.c

View File

@@ -131,6 +131,8 @@ rtems_isr_entry set_vector( /* returns old vector */
int type /* RTEMS or RAW intr */
);
void BSP_fatal_exit(uint32_t error);
void bsp_spurious_initialize( void );
/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function

View File

@@ -368,9 +368,8 @@ zerobss:
#if !defined(START_LEON3_ENABLE_SMP)
PUBLIC(bsp_reset)
SYM(bsp_reset):
mov 1, %g1
ta 0 ! Halt if _main returns ...
nop
call SYM(BSP_fatal_exit)
clr %o0
#endif
/* end of file */

View File

@@ -0,0 +1,19 @@
/**
* @file
* @ingroup sparc_bsp
* @brief ERC32/LEON2/LEON3 BSP specific exit handler.
*
* COPYRIGHT (c) 2014.
* Aeroflex Gaisler AB.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#include <rtems.h>
void BSP_fatal_exit(uint32_t error)
{
sparc_syscall_exit(RTEMS_FATAL_SOURCE_BSP, error);
}