diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-06-25 13:37:40 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-06-25 13:55:32 +0200 |
commit | 0b268b8bdb6c14bc6020b6f0450446fdafc4ae06 (patch) | |
tree | 3946c52f7e27784956e020c2b75e872b1e62bea8 | |
parent | score: Move SMP CPU_USE_DEFERRED_FP_SWITCH check (diff) | |
download | rtems-0b268b8bdb6c14bc6020b6f0450446fdafc4ae06.tar.bz2 |
score: Move default _ISR_Is_in_progress()
-rw-r--r-- | cpukit/score/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/isr.h | 36 | ||||
-rw-r--r-- | cpukit/score/src/isrisinprogress.c | 51 |
3 files changed, 53 insertions, 35 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 3b2c5bce15..3e612d4cf8 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -342,6 +342,7 @@ libscore_a_SOURCES += src/apiext.c src/chain.c src/chainappend.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c +libscore_a_SOURCES += src/isrisinprogress.c libscore_a_SOURCES += src/debugisownerofallocator.c libscore_a_SOURCES += src/profilingisrentryexit.c libscore_a_SOURCES += src/once.c diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h index dcb25e1dff..f76cbcbda8 100644 --- a/cpukit/score/include/rtems/score/isr.h +++ b/cpukit/score/include/rtems/score/isr.h @@ -22,7 +22,6 @@ #define _RTEMS_SCORE_ISR_H #include <rtems/score/isrlevel.h> -#include <rtems/score/percpu.h> /** * @defgroup ScoreISR ISR Handler @@ -136,34 +135,6 @@ void _ISR_Handler( void ); void _ISR_Dispatch( void ); /** - * @brief Returns the current ISR nest level - * - * This function can be called in any context. On SMP configurations - * interrupts are disabled to ensure that the processor index is used - * consistently. - * - * @return The current ISR nest level. - */ -RTEMS_INLINE_ROUTINE uint32_t _ISR_Get_nest_level( void ) -{ - uint32_t isr_nest_level; - - #if defined( RTEMS_SMP ) - ISR_Level level; - - _ISR_Disable_without_giant( level ); - #endif - - isr_nest_level = _ISR_Nest_level; - - #if defined( RTEMS_SMP ) - _ISR_Enable_without_giant( level ); - #endif - - return isr_nest_level; -} - -/** * @brief Checks if an ISR in progress. * * This function returns true if the processor is currently servicing @@ -172,12 +143,7 @@ RTEMS_INLINE_ROUTINE uint32_t _ISR_Get_nest_level( void ) * * @retval This methods returns true when called from an ISR. */ -#if (CPU_PROVIDES_ISR_IS_IN_PROGRESS == TRUE) - bool _ISR_Is_in_progress( void ); -#else - #define _ISR_Is_in_progress() \ - (_ISR_Get_nest_level() != 0) -#endif +bool _ISR_Is_in_progress( void ); #ifdef __cplusplus } diff --git a/cpukit/score/src/isrisinprogress.c b/cpukit/score/src/isrisinprogress.c new file mode 100644 index 0000000000..7607cfe436 --- /dev/null +++ b/cpukit/score/src/isrisinprogress.c @@ -0,0 +1,51 @@ +/** + * @file + * + * @ingroup ScoreISR + * + * @brief ISR Is In Progress Default Implementation + */ + +/* + * Copyright (c) 2013-2015 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * 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. + */ + +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include <rtems/score/isr.h> +#include <rtems/score/percpu.h> + +#if CPU_PROVIDES_ISR_IS_IN_PROGRESS == FALSE + +bool _ISR_Is_in_progress( void ) +{ + uint32_t isr_nest_level; + + #if defined( RTEMS_SMP ) + ISR_Level level; + + _ISR_Disable_without_giant( level ); + #endif + + isr_nest_level = _ISR_Nest_level; + + #if defined( RTEMS_SMP ) + _ISR_Enable_without_giant( level ); + #endif + + return isr_nest_level != 0; +} + +#endif |