From 62590a7331256f4c7546ea815398d43082869403 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 24 Jul 2013 16:30:54 +0200 Subject: score: Merge threadmp implementation into one file --- cpukit/score/include/rtems/score/threadmp.h | 44 +++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'cpukit/score/include/rtems/score/threadmp.h') 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 directly; include instead." #endif +#include + +#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 -#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 */ -- cgit v1.2.3