summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threaddispatch.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-12 09:25:39 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-14 16:26:06 +0200
commit49cdf40afa1b67b1eedbec26b73c59f54dc882cd (patch)
treed5f27895d8bb30533150c66fd019a18291a52e6a /cpukit/score/include/rtems/score/threaddispatch.h
parentscore: Add _Chain_Insert_ordered_unprotected() (diff)
downloadrtems-49cdf40afa1b67b1eedbec26b73c59f54dc882cd.tar.bz2
score: Add and use _Thread_Dispatch_is_enabled()
Delete _Thread_Dispatch_in_critical_section() and _Thread_Is_dispatching_enabled().
Diffstat (limited to 'cpukit/score/include/rtems/score/threaddispatch.h')
-rw-r--r--cpukit/score/include/rtems/score/threaddispatch.h45
1 files changed, 13 insertions, 32 deletions
diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h
index 0333e9b66f..e3065da590 100644
--- a/cpukit/score/include/rtems/score/threaddispatch.h
+++ b/cpukit/score/include/rtems/score/threaddispatch.h
@@ -46,6 +46,19 @@ extern "C" {
*/
SCORE_EXTERN volatile uint32_t _Thread_Dispatch_disable_level;
+/**
+ * @brief Indicates if the executing thread is inside a thread dispatch
+ * critical section.
+ *
+ * @retval true Thread dispatching is enabled.
+ * @retval false The executing thread is inside a thread dispatch critical
+ * section and dispatching is not allowed.
+ */
+RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_is_enabled(void)
+{
+ return _Thread_Dispatch_disable_level == 0;
+}
+
#if defined(RTEMS_SMP)
typedef struct {
SMP_lock_Control lock;
@@ -68,14 +81,6 @@ SCORE_EXTERN volatile uint32_t _Thread_Dispatch_disable_level;
void _Thread_Dispatch_initialization(void);
/**
- * @brief Checks if thread dispatch says that we are in a critical section.
- *
- * This routine returns true if thread dispatch indicates
- * that we are in a critical section.
- */
- bool _Thread_Dispatch_in_critical_section(void);
-
- /**
* @brief Returns value of the the thread dispatch level.
*
* This routine returns value of the the thread dispatch level.
@@ -105,20 +110,6 @@ SCORE_EXTERN volatile uint32_t _Thread_Dispatch_disable_level;
uint32_t _Thread_Dispatch_decrement_disable_level(void);
#else /* RTEMS_SMP */
/**
- * @brief _Thread_Dispatch_in_critical_section
- *
- * This routine returns true if thread dispatch indicates
- * that we are in a critical section.
- */
- RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void)
- {
- if ( _Thread_Dispatch_disable_level == 0 )
- return false;
-
- return true;
- }
-
- /**
* @brief Get thread dispatch disable level.
*
* This routine returns value of the the thread dispatch level.
@@ -246,16 +237,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
_Thread_Dispatch_decrement_disable_level();
}
-/**
- * This function returns true if dispatching is disabled, and false
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE bool _Thread_Is_dispatching_enabled( void )
-{
- return ( _Thread_Dispatch_in_critical_section() == false );
-}
-
/** @} */
#ifdef __cplusplus