From 4fc370e3c64c510d43d1e8808d664513baca2ad7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 5 Jun 2013 12:08:23 +0200 Subject: score: Move thread dispatch content to new file Move thread dispatch declarations and inline functions to new header to make it independent of the Thread_Control structure. This avoids a cyclic dependency in case thread dispatch functions are used for the object implementation. --- cpukit/score/inline/rtems/score/coremutex.inl | 2 + cpukit/score/inline/rtems/score/coresem.inl | 1 + cpukit/score/inline/rtems/score/object.inl | 2 + cpukit/score/inline/rtems/score/thread.inl | 140 -------------------------- 4 files changed, 5 insertions(+), 140 deletions(-) (limited to 'cpukit/score/inline/rtems') diff --git a/cpukit/score/inline/rtems/score/coremutex.inl b/cpukit/score/inline/rtems/score/coremutex.inl index d34a967bd3..591cded136 100644 --- a/cpukit/score/inline/rtems/score/coremutex.inl +++ b/cpukit/score/inline/rtems/score/coremutex.inl @@ -23,6 +23,8 @@ #ifndef _RTEMS_SCORE_COREMUTEX_INL #define _RTEMS_SCORE_COREMUTEX_INL +#include + /** * @addtogroup ScoreMutex */ diff --git a/cpukit/score/inline/rtems/score/coresem.inl b/cpukit/score/inline/rtems/score/coresem.inl index aa021eb1db..0ae3b33cd3 100644 --- a/cpukit/score/inline/rtems/score/coresem.inl +++ b/cpukit/score/inline/rtems/score/coresem.inl @@ -29,6 +29,7 @@ /**@{**/ #include +#include #include /** diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl index 726d676cd9..efdb23d0e3 100644 --- a/cpukit/score/inline/rtems/score/object.inl +++ b/cpukit/score/inline/rtems/score/object.inl @@ -23,6 +23,8 @@ #ifndef _RTEMS_SCORE_OBJECT_INL #define _RTEMS_SCORE_OBJECT_INL +#include + /** * This function builds an object's id from the processor node and index * values specified. diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index a42da1d5b8..e6e192901d 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -31,91 +31,6 @@ */ /**@{**/ -#if defined(RTEMS_SMP) - - /* - * The _Thread_Dispatch_... functions are prototyped in thread.h. - */ - -#else - - /** - * @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. - */ - RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_get_disable_level(void) - { - return _Thread_Dispatch_disable_level; - } - - /** - * @brief Set thread dispatch disable level. - * - * This routine sets thread dispatch level to the - * value passed in. - */ - RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) - { - _Thread_Dispatch_disable_level = value; - return value; - } - - /** - * @brief Increase thread dispatch disable level. - * - * This rountine increments the thread dispatch level - */ - RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) - { - uint32_t level = _Thread_Dispatch_disable_level; - - ++level; - _Thread_Dispatch_disable_level = level; - - return level; - } - - /** - * @brief Decrease thread dispatch disable level. - * - * This routine decrements the thread dispatch level. - */ - RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) - { - uint32_t level = _Thread_Dispatch_disable_level; - - --level; - _Thread_Dispatch_disable_level = level; - - return level; - } - - /** - * @brief Thread dispatch initialization. - * - * This routine initializes the thread dispatching subsystem. - */ - RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) - { - _Thread_Dispatch_set_disable_level( 1 ); - } - -#endif /** * This routine halts multitasking and returns control to @@ -236,61 +151,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) } #endif -/** - * This routine prevents dispatching. - */ - -#if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ ) -void _Thread_Disable_dispatch( void ); -#else -RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) -{ - _Thread_Dispatch_increment_disable_level(); - RTEMS_COMPILER_MEMORY_BARRIER(); -} -#endif - -/** - * This routine allows dispatching to occur again. If this is - * the outer most dispatching critical section, then a dispatching - * operation will be performed and, if necessary, control of the - * processor will be transferred to the heir thread. - */ - -#if defined ( __THREAD_DO_NOT_INLINE_ENABLE_DISPATCH__ ) - void _Thread_Enable_dispatch( void ); -#else - /* inlining of enable dispatching must be true */ - RTEMS_INLINE_ROUTINE void _Thread_Enable_dispatch( void ) - { - RTEMS_COMPILER_MEMORY_BARRIER(); - if ( _Thread_Dispatch_decrement_disable_level() == 0 ) - _Thread_Dispatch(); - } -#endif - -/** - * This routine allows dispatching to occur again. However, - * no dispatching operation is performed even if this is the outer - * most dispatching critical section. - */ - -RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) -{ - RTEMS_COMPILER_MEMORY_BARRIER(); - _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 ); -} - /** * This function returns true if dispatching is disabled, and false * otherwise. -- cgit v1.2.3