summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-24 16:30:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-26 11:55:45 +0200
commit62590a7331256f4c7546ea815398d43082869403 (patch)
tree7a8267de553e6180499837b5978c8f63e190e538 /cpukit/score/include/rtems/score
parentscore: Create states implementation header (diff)
downloadrtems-62590a7331256f4c7546ea815398d43082869403.tar.bz2
score: Merge threadmp implementation into one file
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/threadmp.h44
1 files changed, 35 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h
index 555bca2053..1fa0df72ef 100644
--- a/cpukit/score/include/rtems/score/threadmp.h
+++ b/cpukit/score/include/rtems/score/threadmp.h
@@ -23,6 +23,12 @@
# error "Never use <rtems/score/threadmp.h> directly; include <rtems/score/threadimpl.h> instead."
#endif
+#include <rtems/score/mpci.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @defgroup ScoreThreadMP Thread Handler Multiprocessing Support
*
@@ -35,10 +41,6 @@
*/
/**@{*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @brief Initialize MP thread handler.
*
@@ -87,15 +89,39 @@ SCORE_EXTERN Chain_Control _Thread_MP_Active_proxies;
*/
SCORE_EXTERN Chain_Control _Thread_MP_Inactive_proxies;
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/threadmp.inl>
-#endif
+/**
+ * This function returns true if the thread in question is the
+ * multiprocessing receive thread.
+ *
+ * @note This is a macro to avoid needing a prototype for
+ * _MPCI_Receive_server_tcb until it is used.
+ */
+#define _Thread_MP_Is_receive(_the_thread) \
+ ((_the_thread) == _MPCI_Receive_server_tcb)
-#ifdef __cplusplus
+/**
+ * This routine frees a proxy control block to the
+ * inactive chain of free proxy control blocks.
+ */
+
+RTEMS_INLINE_ROUTINE void _Thread_MP_Free_proxy (
+ Thread_Control *the_thread
+)
+{
+ Thread_Proxy_control *the_proxy;
+
+ the_proxy = (Thread_Proxy_control *) the_thread;
+
+ _Chain_Extract( &the_proxy->Active );
+
+ _Chain_Append( &_Thread_MP_Inactive_proxies, &the_thread->Object.Node );
}
-#endif
/**@}*/
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* end of include file */