diff options
author | Chris Johns <chrisj@rtems.org> | 2019-06-25 18:43:55 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2019-06-28 09:01:27 +1000 |
commit | c43071f5231b07f67116891c0612be4ebdd7f211 (patch) | |
tree | 52c102fa5e8c1cb004a8b4c53ae36a1535d6ba48 /bsps/arm/shared | |
parent | bsp/motorola_powerpc: Fix linker command file (diff) | |
download | rtems-c43071f5231b07f67116891c0612be4ebdd7f211.tar.bz2 |
arm: Return the current handler from arm_cp15_set_exception_handler
Closes #3762
Diffstat (limited to 'bsps/arm/shared')
-rw-r--r-- | bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c b/bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c index b24b7c4eb0..a0cec87589 100644 --- a/bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c +++ b/bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c @@ -16,15 +16,18 @@ #include <bsp/linker-symbols.h> -void arm_cp15_set_exception_handler( +void* arm_cp15_set_exception_handler( Arm_symbolic_exception_name exception, void (*handler)(void) ) { + uint32_t current_handler = 0; + if ((unsigned) exception < MAX_EXCEPTIONS) { uint32_t *cpu_table = (uint32_t *) 0 + MAX_EXCEPTIONS; uint32_t *mirror_table = (uint32_t *) bsp_vector_table_begin + MAX_EXCEPTIONS; - uint32_t current_handler = mirror_table[exception]; + + current_handler = mirror_table[exception]; if (current_handler != (uint32_t) handler) { size_t table_size = MAX_EXCEPTIONS * sizeof(uint32_t); @@ -53,4 +56,6 @@ void arm_cp15_set_exception_handler( rtems_interrupt_local_enable(level); } } + + return (void*) current_handler; } |