summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline/rtems/score/thread.inl
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2011-05-23 13:30:15 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2011-05-23 13:30:15 +0000
commit3a8a9997866ded736b038322be6adccee63eb3bd (patch)
tree64909329b677082e99d3d8bcb71795a43e70192d /cpukit/score/inline/rtems/score/thread.inl
parentFix typo. (diff)
downloadrtems-3a8a9997866ded736b038322be6adccee63eb3bd.tar.bz2
2011-05-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* score/Makefile.am, score/include/rtems/score/thread.h, score/inline/rtems/score/thread.inl: Add smp support to dispable dispatch level accesses. * score/src/threaddispatchdisablelevel.c: New file.
Diffstat (limited to 'cpukit/score/inline/rtems/score/thread.inl')
-rw-r--r--cpukit/score/inline/rtems/score/thread.inl112
1 files changed, 63 insertions, 49 deletions
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl
index 7ff1e615fb..ba13bda908 100644
--- a/cpukit/score/inline/rtems/score/thread.inl
+++ b/cpukit/score/inline/rtems/score/thread.inl
@@ -31,63 +31,77 @@
* @{
*/
-/**
- * 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;
+#if defined(RTEMS_SMP)
- return true;
-}
+ /*
+ * The _Thread_Dispatch_... functions are prototyped in thread.h.
+ */
-/**
- * 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;
-}
+#else
-/**
- * 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 _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;
-/**
- * This rountine increments the thread dispatch level
- */
-RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
-{
- _Thread_Dispatch_disable_level++;
- return _Thread_Dispatch_disable_level;
-}
+ return true;
+ }
-/**
- * This routine decrements the thread dispatch level.
- */
-RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
-{
- _Thread_Dispatch_disable_level--;
- return _Thread_Dispatch_disable_level;
-}
+ /** @brief _Thread_Dispatch_get_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;
+ }
-/**
- * This routine initializes the thread dispatching subsystem.
- */
+ /** @brief _Thread_Dispatch_set_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;
+ }
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
-{
- _Thread_Dispatch_set_disable_level( 1 );
-}
+ /** @brief _Thread_Dispatch_increment_disable_level
+ *
+ * This rountine increments the thread dispatch level
+ */
+ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
+ {
+ _Thread_Dispatch_disable_level++;
+ return _Thread_Dispatch_disable_level;
+ }
+
+ /** @brief _Thread_Dispatch_decrement_disable_level
+ *
+ * This routine decrements the thread dispatch level.
+ */
+ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
+ {
+ _Thread_Dispatch_disable_level--;
+ return _Thread_Dispatch_disable_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