mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-17 05:15:24 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
19
c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c
Normal file
19
c/src/lib/libbsp/sparc/shared/startup/bsp_fatal_exit.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user