forked from Imagelibrary/rtems
bsp/mpc55xx: Set PPC_EXC_CONFIG_USE_FIXED_HANDLER
This commit is contained in:
@@ -69,6 +69,7 @@ libbsp_a_SOURCES += ../../shared/src/stackalloc.c
|
||||
libbsp_a_SOURCES += ../shared/src/bsp-start-zero.S
|
||||
libbsp_a_SOURCES += ../shared/src/memcpy.c
|
||||
libbsp_a_SOURCES += ../shared/src/tictac.c
|
||||
libbsp_a_SOURCES += ../shared/src/ppc-exc-handler-table.c
|
||||
libbsp_a_SOURCES += startup/bspstart.c
|
||||
libbsp_a_SOURCES += startup/bspworkareainit.c
|
||||
libbsp_a_SOURCES += startup/exc-vector-base.S
|
||||
|
||||
@@ -32,6 +32,10 @@ RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([gwlcfm],[])
|
||||
RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1])
|
||||
RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED
|
||||
|
||||
RTEMS_BSPOPTS_SET([PPC_EXC_CONFIG_USE_FIXED_HANDLER],[*],[1])
|
||||
RTEMS_BSPOPTS_HELP([PPC_EXC_CONFIG_USE_FIXED_HANDLER],
|
||||
[use fixed high-level exception handler])
|
||||
|
||||
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5643l*],[127])
|
||||
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5566*],[127])
|
||||
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5674f*],[255])
|
||||
|
||||
@@ -108,7 +108,9 @@ void bsp_start(void)
|
||||
(uintptr_t) bsp_section_work_begin,
|
||||
rtems_configuration_get_interrupt_stack_size()
|
||||
);
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
|
||||
#endif
|
||||
|
||||
/* Initialize interrupts */
|
||||
bsp_interrupt_initialize();
|
||||
|
||||
@@ -59,9 +59,15 @@ mpc55xx_exc_vector_base:
|
||||
li r4, 4
|
||||
b ppc_exc_wrap_nopush_std
|
||||
stwu r1, -PPC_EXC_MINIMAL_FRAME_SIZE(r1)
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
stw r4, PPC_EXC_VECTOR_PROLOGUE_OFFSET(r1)
|
||||
li r4, -32763
|
||||
#endif
|
||||
b ppc_exc_wrap_async_normal
|
||||
#ifdef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
stwu r1, -EXC_GENERIC_SIZE(r1)
|
||||
stw r4, GPR4_OFFSET(r1)
|
||||
li r4, 6
|
||||
@@ -83,13 +89,25 @@ mpc55xx_exc_vector_base:
|
||||
li r4, 24
|
||||
b ppc_exc_wrap_nopush_std
|
||||
stwu r1, -PPC_EXC_MINIMAL_FRAME_SIZE(r1)
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
stw r4, PPC_EXC_VECTOR_PROLOGUE_OFFSET(r1)
|
||||
li r4, -32752
|
||||
#endif
|
||||
b ppc_exc_wrap_async_normal
|
||||
#ifdef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
stwu r1, -PPC_EXC_MINIMAL_FRAME_SIZE(r1)
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
stw r4, PPC_EXC_VECTOR_PROLOGUE_OFFSET(r1)
|
||||
li r4, -32749
|
||||
#endif
|
||||
b ppc_exc_wrap_async_normal
|
||||
#ifdef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
stw r1, ppc_exc_lock_crit@sdarel(r13)
|
||||
stw r4, ppc_exc_vector_register_crit@sdarel(r13)
|
||||
li r4, -32748
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008
|
||||
* Embedded Brains GmbH
|
||||
* Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* rtems@embedded-brains.de
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
@@ -112,10 +113,7 @@ rtems_status_code mpc55xx_interrupt_handler_install(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief External exception handler.
|
||||
*/
|
||||
static int mpc55xx_external_exception_handler( BSP_Exception_frame *frame, unsigned exception_number)
|
||||
static void mpc55xx_interrupt_dispatch(void)
|
||||
{
|
||||
/* Acknowlege interrupt request */
|
||||
rtems_vector_number vector = INTC.IACKR.B.INTVEC;
|
||||
@@ -131,18 +129,39 @@ static int mpc55xx_external_exception_handler( BSP_Exception_frame *frame, unsig
|
||||
|
||||
/* End of interrupt */
|
||||
INTC.EOIR.R = 1;
|
||||
}
|
||||
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
|
||||
/**
|
||||
* @brief External exception handler.
|
||||
*/
|
||||
static int mpc55xx_external_exception_handler( BSP_Exception_frame *frame, unsigned exception_number)
|
||||
{
|
||||
mpc55xx_interrupt_dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* PPC_EXC_CONFIG_USE_FIXED_HANDLER */
|
||||
|
||||
void bsp_interrupt_dispatch(void)
|
||||
{
|
||||
mpc55xx_interrupt_dispatch();
|
||||
}
|
||||
|
||||
#endif /* PPC_EXC_CONFIG_USE_FIXED_HANDLER */
|
||||
|
||||
rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
{
|
||||
rtems_vector_number vector;
|
||||
|
||||
#ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
|
||||
/* Install exception handler */
|
||||
if (ppc_exc_set_handler( ASM_EXT_VECTOR, mpc55xx_external_exception_handler)) {
|
||||
return RTEMS_IO_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize interrupt controller */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user