[PATCH] cpukit: pppd: fix compile warning
rcsid is defined, but not used. So discard it. Signed-off-by: Peng Fan --- cpukit/pppd/auth.c | 4 cpukit/pppd/ccp.c | 4 cpukit/pppd/chap.c | 4 cpukit/pppd/demand.c| 4 cpukit/pppd/fsm.c | 4 cpukit/pppd/ipcp.c | 4 cpukit/pppd/lcp.c | 4 cpukit/pppd/magic.c | 4 cpukit/pppd/options.c | 4 cpukit/pppd/rtemsmain.c | 4 cpukit/pppd/sys-rtems.c | 5 - cpukit/pppd/upap.c | 4 cpukit/pppd/utils.c | 4 13 files changed, 53 deletions(-) diff --git a/cpukit/pppd/auth.c b/cpukit/pppd/auth.c index fb84f1e..9df1d32 100644 --- a/cpukit/pppd/auth.c +++ b/cpukit/pppd/auth.c @@ -32,8 +32,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - #include #include #include @@ -75,8 +73,6 @@ #endif #include "pathnames.h" -static const char rcsid[] = RCSID; - /* The name by which the peer authenticated itself to us. */ char peer_authname[MAXNAMELEN]; diff --git a/cpukit/pppd/ccp.c b/cpukit/pppd/ccp.c index d80df27..6ada96c 100644 --- a/cpukit/pppd/ccp.c +++ b/cpukit/pppd/ccp.c @@ -25,8 +25,6 @@ * OR MODIFICATIONS. */ -#define RCSID "$Id$" - #include #include @@ -35,8 +33,6 @@ #include "ccp.h" #include -static const char rcsid[] = RCSID; - /* * Command-line options. */ diff --git a/cpukit/pppd/chap.c b/cpukit/pppd/chap.c index 3fe766f..55f1896 100644 --- a/cpukit/pppd/chap.c +++ b/cpukit/pppd/chap.c @@ -33,8 +33,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - /* * TODO: */ @@ -52,8 +50,6 @@ #include "chap_ms.h" #endif -static const char rcsid[] = RCSID; - /* * Command-line options. */ diff --git a/cpukit/pppd/demand.c b/cpukit/pppd/demand.c index a094a15..a5c13f7 100644 --- a/cpukit/pppd/demand.c +++ b/cpukit/pppd/demand.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$"; - #include #include #include @@ -43,8 +41,6 @@ #include "ipcp.h" #include "lcp.h" -static const char rcsid[] = RCSID; - static unsigned char *frame; static int framelen; static int framemax; diff --git a/cpukit/pppd/fsm.c b/cpukit/pppd/fsm.c index ce06401..4ff17d8 100644 --- a/cpukit/pppd/fsm.c +++ b/cpukit/pppd/fsm.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - /* * TODO: * Randomize fsm id on link/init. @@ -32,8 +30,6 @@ #include "pppd.h" #include "fsm.h" -static const char rcsid[] = RCSID; - static void fsm_timeout(void *); static void fsm_rconfreq(fsm *, u_char, u_char *, int); static void fsm_rconfack(fsm *, int, u_char *, int); diff --git a/cpukit/pppd/ipcp.c b/cpukit/pppd/ipcp.c index fd23ddd..a9a8f24 100644 --- a/cpukit/pppd/ipcp.c +++ b/cpukit/pppd/ipcp.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - /* * TODO: */ @@ -40,8 +38,6 @@ #include -static const char rcsid[] = RCSID; - /* global vars */ ipcp_options ipcp_wantoptions[NUM_PPP];/* Options that we want to request */ ipcp_options ipcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ diff --git a/cpukit/pppd/lcp.c b/cpukit/pppd/lcp.c index 9da1326..e09e8fb 100644 --- a/cpukit/pppd/lcp.c +++ b/cpukit/pppd/lcp.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$"; - /* * TODO: */ @@ -33,8 +31,6 @@ #include "chap.h" #include "magic.h" -static const char rcsid[] = RCSID; - /* * LCP-related command-line options. */ diff --git a/cpukit/pppd/magic.c b/cpukit/pppd/magic.c index 3d297e5..46add2f 100644 --- a/cpukit/pppd/magic.c +++ b/cpukit/pppd/magic.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - #include #include #include @@ -28,8 +26,6 @@ #include "pppd.h" #include "magic.h" -static const char rcsid[] = RCSID; - /* * magic_init - Initialize the magic number generator. * diff --git a/cpukit/pppd/options.c b/cpukit/pppd/options.c index 8a39266..9086e55 100644 --- a/cpukit/pppd/options.c +++ b/cpukit/pppd/options.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - #include #include #include @@ -53,8 +51,6 @@ #include -static const char rcsid[] = RCSID; - /* * Option variables and default values. */ diff --git a/cpukit/pppd/rtemsmain.c b/cpukit/pppd/rtemsmain.c index 89ed776..030bebe 100644 --- a/cpukit/pppd/rtemsmain.c +++ b/cpukit/pppd/rtemsmain.c @@ -17,8 +17,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id$" - #include #include #include @@ -68,8 +66,6 @@ #include "atcp.h" #endif -static const char rcsid[] = RCSID; - /* interface v
[PATCH] score: Delete Thread_Wait_information::id
This field was only by the monitor in non-multiprocessing configurations. Add new field Thread_Wait_information::remote_id in multiprocessing configurations and use it for the remote procedure call thread queue. Add _Thread_Wait_get_id() to obtain the object identifier for debug and system information tools. Ensure the object layout via static asserts. Add test cases to sptests/spthreadq01. --- cpukit/libmisc/monitor/mon-task.c| 32 +- cpukit/posix/include/rtems/posix/cond.h | 2 +- cpukit/posix/include/rtems/posix/mqueue.h| 2 +- cpukit/posix/include/rtems/posix/mutex.h | 2 +- cpukit/posix/include/rtems/posix/semaphore.h | 2 +- cpukit/posix/src/condwaitsupp.c | 7 +- cpukit/posix/src/mqueuerecvsupp.c| 6 + cpukit/posix/src/mutexlocksupp.c | 3 + cpukit/posix/src/pbarrierwait.c | 4 +- cpukit/posix/src/prwlockwrlock.c | 4 +- cpukit/posix/src/semaphorewaitsupp.c | 6 + cpukit/rtems/include/rtems/rtems/barrier.h | 4 +- cpukit/rtems/include/rtems/rtems/message.h | 4 +- cpukit/rtems/include/rtems/rtems/sem.h | 14 +- cpukit/rtems/src/barrierwait.c | 4 +- cpukit/rtems/src/msgqreceive.c | 7 +- cpukit/rtems/src/regiongetsegment.c | 1 - cpukit/rtems/src/semobtain.c | 12 +- cpukit/score/Makefile.am | 1 + cpukit/score/include/rtems/score/coremuteximpl.h | 1 - cpukit/score/include/rtems/score/coresemimpl.h | 1 - cpukit/score/include/rtems/score/thread.h| 9 +- cpukit/score/include/rtems/score/threadimpl.h| 36 +++ cpukit/score/src/corebarrierwait.c | 2 - cpukit/score/src/coremsgseize.c | 1 - cpukit/score/src/coremsgsubmit.c | 1 - cpukit/score/src/corerwlockobtainread.c | 1 - cpukit/score/src/corerwlockobtainwrite.c | 1 - cpukit/score/src/mpci.c | 2 +- cpukit/score/src/threadmp.c | 1 - cpukit/score/src/threadqextractwithproxy.c | 2 +- cpukit/score/src/threadwaitgetid.c | 54 testsuites/sptests/spthreadq01/init.c| 365 ++- 33 files changed, 550 insertions(+), 44 deletions(-) create mode 100644 cpukit/score/src/threadwaitgetid.c diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c index 341a403..96891e2 100644 --- a/cpukit/libmisc/monitor/mon-task.c +++ b/cpukit/libmisc/monitor/mon-task.c @@ -14,26 +14,46 @@ #include #include /* memcpy() */ +static void +rtems_monitor_task_wait_info( +rtems_monitor_task_t *canonical_task, +Thread_Control *rtems_thread +) +{ +ISR_lock_Context lock_context; +void *lock; + +lock = _Thread_Lock_acquire( rtems_thread, &lock_context ); + +canonical_task->state = rtems_thread->current_state; +canonical_task->wait_id = _Thread_Wait_get_id( rtems_thread ); +canonical_task->wait_queue = rtems_thread->Wait.queue; +canonical_task->wait_operations = rtems_thread->Wait.operations; + +_Thread_Lock_release( lock, &lock_context ); +} + void rtems_monitor_task_canonical( rtems_monitor_task_t *canonical_task, const void*thread_void ) { -const Thread_Control *rtems_thread = (const Thread_Control *) thread_void; -RTEMS_API_Control*api; +Thread_Control*rtems_thread; +RTEMS_API_Control *api; + +rtems_thread = + RTEMS_DECONST( Thread_Control *, (const Thread_Control *) thread_void ); api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ]; +rtems_monitor_task_wait_info( canonical_task, rtems_thread ); + canonical_task->entry = rtems_thread->Start.Entry; canonical_task->stack = rtems_thread->Start.Initial_stack.area; canonical_task->stack_size = rtems_thread->Start.Initial_stack.size; canonical_task->cpu = _Per_CPU_Get_index( _Thread_Get_CPU( rtems_thread ) ); canonical_task->priority = rtems_thread->current_priority; -canonical_task->state = rtems_thread->current_state; -canonical_task->wait_id = rtems_thread->Wait.id; -canonical_task->wait_queue = rtems_thread->Wait.queue; -canonical_task->wait_operations = rtems_thread->Wait.operations; canonical_task->events = api->Event.pending_events; /* * FIXME: make this optionally cpu_time_executed diff --git a/cpukit/posix/include/rtems/posix/cond.h b/cpukit/posix/include/rtems/posix/cond.h index 00a0fdb..1839279 100644 --- a/cpukit/posix/include/rtems/posix/cond.h +++ b/cpukit/posix/include/rtems/posix/cond.h @@ -42,9 +42,9 @@ extern "C" { typedef struct { Objects_Control Object; + Thread_queue_Control Wait_queue; int process_shared; pthread_mutex_t Mutex; - Thread_queue_Control Wa
[PATCH 01/15] posix: Use proper lock for signals
--- cpukit/posix/src/killinfo.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c index a29a8e6..7a70539 100644 --- a/cpukit/posix/src/killinfo.c +++ b/cpukit/posix/src/killinfo.c @@ -75,6 +75,7 @@ int killinfo( siginfo_t *siginfo; POSIX_signals_Siginfo_node *psiginfo; Thread_queue_Heads *heads; + ISR_lock_Context lock_context; /* * Only supported for the "calling process" (i.e. this node). @@ -331,20 +332,27 @@ post_process_signal: */ _POSIX_signals_Set_process_signals( mask ); + _POSIX_signals_Acquire( &lock_context ); + if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) - _Chain_Get( &_POSIX_signals_Inactive_siginfo ); + _Chain_Get_unprotected( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { + _POSIX_signals_Release( &lock_context ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; -_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); +_Chain_Append_unprotected( + &_POSIX_signals_Siginfo[ sig ], + &psiginfo->Node +); } + _POSIX_signals_Release( &lock_context ); DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 14/15] score: Delete _Chain_Get()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 9 --- cpukit/sapi/src/chainprotected.c | 4 --- cpukit/score/Makefile.am | 1 - cpukit/score/include/rtems/score/chainimpl.h | 16 cpukit/score/src/chainget.c | 39 5 files changed, 69 deletions(-) delete mode 100644 cpukit/score/src/chainget.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 4bbdd53..d925444 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -591,18 +591,9 @@ RTEMS_INLINE_ROUTINE void rtems_chain_extract_unprotected( * * NOTE: It disables interrupts to ensure the atomicity of the get operation. */ -#if defined( RTEMS_SMP ) rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ); -#else -RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( - rtems_chain_control *the_chain -) -{ - return _Chain_Get( the_chain ); -} -#endif /** * @brief See _Chain_Get_unprotected(). diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index e3ae7fd..0135666 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -40,8 +40,6 @@ void rtems_chain_extract( rtems_chain_node *node ) chain_release( &lock_context ); } -#if defined( RTEMS_SMP ) - rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) { rtems_chain_node *node; @@ -54,8 +52,6 @@ rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) return node; } -#endif /* defined( RTEMS_SMP ) */ - void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) { rtems_interrupt_lock_context lock_context; diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 6b4afdf..403508d 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -346,7 +346,6 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ -src/chainget.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index 40f9fd1..166b58b 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -80,22 +80,6 @@ void _Chain_Initialize( ); /** - * @brief Obtain the first node on a chain. - * - * This function removes the first node from @a the_chain and returns - * a pointer to that node. If @a the_chain is empty, then NULL is returned. - * - * @retval This method returns a pointer a node. If a node was removed, - * then a pointer to that node is returned. If @a the_chain was - * empty, then NULL is returned. - * - * @note It disables interrupts to ensure the atomicity of the get operation. - */ -Chain_Node *_Chain_Get( - Chain_Control *the_chain -); - -/** * @brief Append a node on the end of a chain. * * This routine appends @a the_node onto the end of @a the_chain. diff --git a/cpukit/score/src/chainget.c b/cpukit/score/src/chainget.c deleted file mode 100644 index 86bdc23..000 --- a/cpukit/score/src/chainget.c +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file - * - * @brief Get the First Node - * @ingroup ScoreChain - */ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -Chain_Node *_Chain_Get( - Chain_Control *the_chain -) -{ - ISR_Level level; - Chain_Node *return_node; - - return_node = NULL; - _ISR_Disable( level ); -if ( !_Chain_Is_empty( the_chain ) ) - return_node = _Chain_Get_first_unprotected( the_chain ); - _ISR_Enable( level ); - return return_node; -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 03/15] posix: Fix _POSIX_signals_Check_signal()
Do not save and restore the thread wait information. This is superfluous and may overwrite thread wait information updates due to interrupts leading to system corruption. --- cpukit/posix/src/psignal.c | 31 +++ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 354fb33..6e18e05 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -113,10 +113,8 @@ static void _POSIX_signals_Check_signal( boolis_global ) { - siginfo_t siginfo_struct; - sigset_tsaved_signals_unblocked; - Thread_Wait_information stored_thread_wait_information; - Thread_Control *executing; + siginfo_t siginfo_struct; + sigset_t saved_signals_unblocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, is_global, true, true ) ) @@ -143,16 +141,6 @@ static void _POSIX_signals_Check_signal( saved_signals_unblocked = api->signals_unblocked; api->signals_unblocked &= ~_POSIX_signals_Vectors[ signo ].sa_mask; - executing = _Thread_Get_executing(); - - /* - * We have to save the blocking information of the current wait queue - * because the signal handler may subsequently go on and put the thread - * on a wait queue, for its own purposes. - */ - memcpy( &stored_thread_wait_information, &executing->Wait, - sizeof( stored_thread_wait_information )); - /* * Here, the signal handler function executes */ @@ -170,12 +158,6 @@ static void _POSIX_signals_Check_signal( } /* - * Restore the blocking information - */ - memcpy( &executing->Wait, &stored_thread_wait_information, - sizeof( executing->Wait )); - - /* * Restore the previous set of unblocked signals */ api->signals_unblocked = saved_signals_unblocked; @@ -211,6 +193,15 @@ void _POSIX_signals_Action_handler( return; /* + * In case the executing thread is blocked or about to block on something + * that uses the thread wait information, then this is a kernel bug. + */ + _Assert( +( _Thread_Wait_flags_get( executing ) + & ( THREAD_WAIT_STATE_BLOCKED | THREAD_WAIT_STATE_INTEND_TO_BLOCK ) ) == 0 + ); + + /* * If we invoke any user code, there is the possibility that * a new signal has been posted that we should process so we * restart the loop if a signal handler was invoked. -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 09/15] score: Delete _Chain_Append_with_empty_check()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 10 --- cpukit/sapi/src/chainprotected.c | 4 +-- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/chainimpl.h | 19 cpukit/score/src/chainappendempty.c | 44 5 files changed, 3 insertions(+), 76 deletions(-) delete mode 100644 cpukit/score/src/chainappendempty.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index ba8cd32..01d743f 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -750,20 +750,10 @@ RTEMS_INLINE_ROUTINE void rtems_chain_prepend_unprotected( * @retval true The chain was empty before the append. * @retval false The chain contained at least one node before the append. */ -#if defined( RTEMS_SMP ) bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ); -#else -RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check( - rtems_chain_control *chain, - rtems_chain_node *node -) -{ - return _Chain_Append_with_empty_check( chain, node ); -} -#endif /** * @brief Checks if the @a chain is empty and prepends the @a node. diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index ce8bc5e..51842f4 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -89,8 +89,6 @@ void rtems_chain_prepend( chain_release( &lock_context ); } -#if defined( RTEMS_SMP ) - bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node @@ -106,6 +104,8 @@ bool rtems_chain_append_with_empty_check( return was_empty; } +#if defined( RTEMS_SMP ) + bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index eb5bfa3..93490dc 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -347,7 +347,7 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ src/chainextract.c src/chainget.c src/chaininsert.c \ -src/chainappendempty.c src/chainprependempty.c src/chaingetempty.c \ +src/chainprependempty.c src/chaingetempty.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index 8b888a7..4153107 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -145,25 +145,6 @@ void _Chain_Append( ); /** - * @brief Append a node and check if the chain was empty before. - * - * This routine appends the_node onto the end of the_chain. - * - * @param[in] the_chain is the chain to be operated upon. - * @param[in] the_node is the node to be appended. - * - * @note It disables interrupts to ensure the atomicity of the append - * operation. - * - * @retval true The chain was empty before. - * @retval false The chain contained at least one node before. - */ -bool _Chain_Append_with_empty_check( - Chain_Control *the_chain, - Chain_Node*the_node -); - -/** * @brief Prepend a node and check if the chain was empty before. * * This routine prepends the_node onto the front of the_chain. diff --git a/cpukit/score/src/chainappendempty.c b/cpukit/score/src/chainappendempty.c deleted file mode 100644 index 7f5d924..000 --- a/cpukit/score/src/chainappendempty.c +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file - * - * @ingroup ScoreChain - * - * @brief _Chain_Append_with_empty_check() implementation. - */ - -/* - * Copyright (c) 2010 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -bool _Chain_Append_with_empty_check( - Chain_Control *chain, - Chain_Node *node -) -{ - ISR_Level level; - bool was_empty; - - _ISR_Disable( level ); - was_empty = _Chain_Append_with_empty_check_unprotected( chain, node ); - _ISR_Enable( level ); - - return was_empty; -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 06/15] score: Use red-black tree for active global objects
Use a red-black tree to lookup active global objects by identifier or name. Update #2555. --- cpukit/sapi/include/confdefs.h | 9 - cpukit/score/include/rtems/score/object.h | 46 ++- cpukit/score/include/rtems/score/objectimpl.h | 16 +- cpukit/score/include/rtems/score/objectmp.h| 39 +-- cpukit/score/src/objectget.c | 6 +- cpukit/score/src/objectgetisr.c| 4 +- cpukit/score/src/objectinitializeinformation.c | 18 +- cpukit/score/src/objectmp.c| 374 + testsuites/sptests/spsize/size.c | 5 - 9 files changed, 318 insertions(+), 199 deletions(-) diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 6b7aa90..807ea92 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -2973,17 +2973,8 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; * This is an internal parameter. */ #ifdef CONFIGURE_MP_APPLICATION - #define CONFIGURE_OBJECT_GLOBAL_TABLE_SIZE(_max) \ -_Configure_From_workspace( \ - (CONFIGURE_MP_MAXIMUM_NODES + 1) * sizeof(Chain_Control) \ -) - #define CONFIGURE_MEMORY_FOR_MP \ (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ - CONFIGURE_OBJECT_GLOBAL_TABLE_SIZE(CONFIGURE_TASKS) + \ - CONFIGURE_OBJECT_GLOBAL_TABLE_SIZE(CONFIGURE_MAXIMUM_PARTITIONS) + \ - CONFIGURE_OBJECT_GLOBAL_TABLE_SIZE(CONFIGURE_SEMAPHORES) + \ - CONFIGURE_OBJECT_GLOBAL_TABLE_SIZE(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS)) #else #define CONFIGURE_MEMORY_FOR_MP 0 diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 70e5fe6..c2acb2d 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -240,18 +241,45 @@ typedef struct { #if defined( RTEMS_MULTIPROCESSING ) /** - * This defines the Global Object Control Block used to manage - * objects resident on other nodes. It is derived from Object. + * @brief This defines the Global Object Control Block used to manage objects + * resident on other nodes. */ typedef struct { - /** This is an object control structure. */ - Objects_Control Object; - /** This is the name of the object. Using an unsigned thirty two - * bit value is broken but works. If any API is MP with variable - * length names .. BOOM + /** + * @brief Nodes to manage active and inactive global objects. + */ + union { +/** + * @brief Inactive global objects reside on a chain. + */ +Chain_Node Inactive; + +struct { + /** + * @brief Node to lookup an active global object by identifier. + */ + RBTree_Node Id_lookup; + + /** + * @brief Node to lookup an active global object by name. + */ + RBTree_Node Name_lookup; +} Active; + } Nodes; + + /** + * @brief The global object identifier. + */ + Objects_Id id; + + /** + * @brief The global object name. + * + * Using an unsigned thirty two bit value is broken but works. If any API is + * MP with variable length names .. BOOM */ - uint32_tname; -} Objects_MP_Control; + uint32_t name; +} Objects_MP_Control; #endif /** diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h index 786910e..aed7faf 100644 --- a/cpukit/score/include/rtems/score/objectimpl.h +++ b/cpukit/score/include/rtems/score/objectimpl.h @@ -172,8 +172,20 @@ typedef struct { #if defined(RTEMS_MULTIPROCESSING) /** This is this object class' method called when extracting a thread. */ Objects_Thread_queue_Extract_callout extract; -/** This is this object class' pointer to the global name table */ -Chain_Control*global_table; + +/** + * @brief The global objects of this object information sorted by object + * identifier. + */ +RBTree_Control Global_by_id; + +/** + * @brief The global objects of this object information sorted by object + * name. + * + * Objects with the same name are sorted according to their identifier. + */ +RBTree_Control Global_by_name; #endif } Objects_Information; diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h index a78ca82..83fcfad 100644 --- a/cpukit/score/include/rtems/score/objectmp.h +++ b/cpukit/score/include/rtems/score/objectmp.h @@ -153,21 +153,24 @@ Objects_Name_or_id_lookup_errors _Objects_MP_Global_name_search ( * location is set to objects_error. In both cases, the_object * is undefined. * + * A returned object is actually of type Objects_MP_Control which has nothing + * to do with Objects_Control. So, be careful. Th
[PATCH 08/15] score: Delete _Chain_Prepend()
This function is not used in the score. Update #2555. --- cpukit/sapi/Makefile.am | 2 +- cpukit/sapi/include/rtems/chain.h| 10 -- cpukit/sapi/src/chainprotected.c | 139 +++ cpukit/sapi/src/chainsmp.c | 136 -- cpukit/score/include/rtems/score/chainimpl.h | 19 5 files changed, 140 insertions(+), 166 deletions(-) create mode 100644 cpukit/sapi/src/chainprotected.c delete mode 100644 cpukit/sapi/src/chainsmp.c diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am index edfdfc1..8970e3d 100644 --- a/cpukit/sapi/Makefile.am +++ b/cpukit/sapi/Makefile.am @@ -35,7 +35,7 @@ libsapi_a_SOURCES = src/extension.c src/extensioncreate.c \ src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \ src/chainprependnotify.c src/rbheap.c src/interrtext.c \ src/fatal2.c src/fatalsrctext.c -libsapi_a_SOURCES += src/chainsmp.c +libsapi_a_SOURCES += src/chainprotected.c libsapi_a_SOURCES += src/cpucounterconverter.c libsapi_a_SOURCES += src/delayticks.c libsapi_a_SOURCES += src/delaynano.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 4d586ff..ba8cd32 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -718,20 +718,10 @@ RTEMS_INLINE_ROUTINE void rtems_chain_append_unprotected( * NOTE: It disables interrupts to ensure the atomicity of the * prepend operation. */ -#if defined( RTEMS_SMP ) void rtems_chain_prepend( rtems_chain_control *the_chain, rtems_chain_node*the_node ); -#else -RTEMS_INLINE_ROUTINE void rtems_chain_prepend( - rtems_chain_control *the_chain, - rtems_chain_node*the_node -) -{ - _Chain_Prepend( the_chain, the_node ); -} -#endif /** * @brief Prepend a node (unprotected). diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c new file mode 100644 index 000..ce8bc5e --- /dev/null +++ b/cpukit/sapi/src/chainprotected.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2013, 2016 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include +#include + +RTEMS_INTERRUPT_LOCK_DEFINE( static, chain_lock, "Chains" ) + +static void chain_acquire( rtems_interrupt_lock_context *lock_context ) +{ + rtems_interrupt_lock_acquire( &chain_lock, lock_context ); +} + +static void chain_release( rtems_interrupt_lock_context *lock_context ) +{ + rtems_interrupt_lock_release( &chain_lock, lock_context ); +} + +#if defined( RTEMS_SMP ) + +void rtems_chain_extract( rtems_chain_node *node ) +{ + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + _Chain_Extract_unprotected( node ); + chain_release( &lock_context ); +} + +rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) +{ + rtems_chain_node *node; + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + node = _Chain_Get_unprotected( chain ); + chain_release( &lock_context ); + + return node; +} + +void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) +{ + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + _Chain_Insert_unprotected( after_node, node ); + chain_release( &lock_context ); +} + +void rtems_chain_append( + rtems_chain_control *chain, + rtems_chain_node *node +) +{ + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + _Chain_Append_unprotected( chain, node ); + chain_release( &lock_context ); +} + +#endif /* defined( RTEMS_SMP ) */ + +void rtems_chain_prepend( + rtems_chain_control *chain, + rtems_chain_node *node +) +{ + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + _Chain_Prepend_unprotected( chain, node ); + chain_release( &lock_context ); +} + +#if defined( RTEMS_SMP ) + +bool rtems_chain_append_with_empty_check( + rtems_chain_control *chain, + rtems_chain_node *node +) +{ + bool was_empty; + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + was_empty = _Chain_Append_with_empty_check_unprotected( chain, node ); + chain_release( &lock_context ); + + return was_empty; +} + +bool rtems_chain_prepend_with_empty_check( + rtems_chain_control *chain, + rtems_chain_node *node +) +{ + bool was_empty; + rtems_interrupt_lock_context lock_context; + + chain_acquire( &lock_context ); + was_empty = _Chain_Prepend_with_empty_check_unprotected( chain, node ); + chain_release( &lock_context ); + + return was_empty; +} + +bool rtems_chain_get_with_empty_check( + rtems_chain_control *chain, + rtems_chain_node **node +) +{ + bool is_
[PATCH 02/15] posix: Make _POSIX_signals_Check_signal() static
--- cpukit/posix/Makefile.am | 2 +- cpukit/posix/include/rtems/posix/psignalimpl.h | 9 -- cpukit/posix/src/psignal.c | 74 cpukit/posix/src/psignalchecksignal.c | 113 - 4 files changed, 75 insertions(+), 123 deletions(-) delete mode 100644 cpukit/posix/src/psignalchecksignal.c diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am index dcedf5b..ed62232 100644 --- a/cpukit/posix/Makefile.am +++ b/cpukit/posix/Makefile.am @@ -147,7 +147,7 @@ endif ## PSIGNAL_C_FILES libposix_a_SOURCES += src/psignal.c src/alarm.c src/kill.c src/killinfo.c \ src/kill_r.c src/pause.c src/psignalclearprocesssignals.c \ -src/psignalsetprocesssignals.c src/psignalchecksignal.c \ +src/psignalsetprocesssignals.c \ src/psignalclearsignals.c src/psignalunblockthread.c src/pthreadkill.c \ src/pthreadsigmask.c src/sigaction.c endif diff --git a/cpukit/posix/include/rtems/posix/psignalimpl.h b/cpukit/posix/include/rtems/posix/psignalimpl.h index eeb060e..7c1424c 100644 --- a/cpukit/posix/include/rtems/posix/psignalimpl.h +++ b/cpukit/posix/include/rtems/posix/psignalimpl.h @@ -96,15 +96,6 @@ bool _POSIX_signals_Unblock_thread( ); /** - * @brief Check POSIX signal. - */ -bool _POSIX_signals_Check_signal( - POSIX_API_Control *api, - int signo, - boolis_global -); - -/** * @brief Clear POSIX signals. */ bool _POSIX_signals_Clear_signals( diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 18aad96..354fb33 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -107,6 +107,80 @@ Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) +static void _POSIX_signals_Check_signal( + POSIX_API_Control *api, + int signo, + boolis_global +) +{ + siginfo_t siginfo_struct; + sigset_tsaved_signals_unblocked; + Thread_Wait_information stored_thread_wait_information; + Thread_Control *executing; + + if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, + is_global, true, true ) ) +return; + + /* + * Since we made a union of these, only one test is necessary but this is + * safer. + */ + #if defined(RTEMS_DEBUG) +assert( _POSIX_signals_Vectors[ signo ].sa_handler || +_POSIX_signals_Vectors[ signo ].sa_sigaction ); + #endif + + /* + * Just to prevent sending a signal which is currently being ignored. + */ + if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) +return; + + /* + * Block the signals requested in sa_mask + */ + saved_signals_unblocked = api->signals_unblocked; + api->signals_unblocked &= ~_POSIX_signals_Vectors[ signo ].sa_mask; + + executing = _Thread_Get_executing(); + + /* + * We have to save the blocking information of the current wait queue + * because the signal handler may subsequently go on and put the thread + * on a wait queue, for its own purposes. + */ + memcpy( &stored_thread_wait_information, &executing->Wait, + sizeof( stored_thread_wait_information )); + + /* + * Here, the signal handler function executes + */ + switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { +case SA_SIGINFO: + (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( +signo, +&siginfo_struct, +NULL/* context is undefined per 1003.1b-1993, p. 66 */ + ); + break; +default: + (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); + break; + } + + /* + * Restore the blocking information + */ + memcpy( &executing->Wait, &stored_thread_wait_information, + sizeof( executing->Wait )); + + /* + * Restore the previous set of unblocked signals + */ + api->signals_unblocked = saved_signals_unblocked; +} + void _POSIX_signals_Action_handler( Thread_Control *executing, Thread_Action *action, diff --git a/cpukit/posix/src/psignalchecksignal.c b/cpukit/posix/src/psignalchecksignal.c deleted file mode 100644 index 990bcc2..000 --- a/cpukit/posix/src/psignalchecksignal.c +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file - * - * @brief POSIX Signals Check Signal - * @ingroup POSIX_SIGNALS - */ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#if defined(RTEMS_DEBUG) - #include -#endif -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include
[PATCH 04/15] score: Add node adjust to _RBTree_Find_inline()
--- cpukit/posix/include/rtems/posix/keyimpl.h | 14 ++ cpukit/posix/src/keygetspecific.c | 15 ++- cpukit/posix/src/keysetspecific.c | 29 + cpukit/score/include/rtems/score/rbtree.h | 12 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h index 7095a16..a534b7e 100644 --- a/cpukit/posix/include/rtems/posix/keyimpl.h +++ b/cpukit/posix/include/rtems/posix/keyimpl.h @@ -139,16 +139,22 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_less( return *the_left < the_right->key; } -RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Key_value_find( - pthread_key_t key, - Thread_Control *the_thread +RTEMS_INLINE_ROUTINE void *_POSIX_Keys_Key_value_adjust( RBTree_Node *node ) +{ + return POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); +} + +RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair *_POSIX_Keys_Key_value_find( + pthread_key_t key, + Thread_Control *the_thread ) { return _RBTree_Find_inline( &the_thread->Keys.Key_value_pairs, &key, _POSIX_Keys_Key_value_equal, -_POSIX_Keys_Key_value_less +_POSIX_Keys_Key_value_less, +_POSIX_Keys_Key_value_adjust ); } diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c index 08ac1ed..ae29955 100644 --- a/cpukit/posix/src/keygetspecific.c +++ b/cpukit/posix/src/keygetspecific.c @@ -30,20 +30,17 @@ void *pthread_getspecific( pthread_key_t key ) { - Thread_Control *executing; - ISR_lock_Context lock_context; - RBTree_Node *node; - void *value; + Thread_Control*executing; + ISR_lock_Context lock_context; + POSIX_Keys_Key_value_pair *key_value_pair; + void *value; executing = _Thread_Get_executing(); _POSIX_Keys_Key_value_acquire( executing, &lock_context ); - node = _POSIX_Keys_Key_value_find( key, executing ); + key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); - if ( node != NULL ) { -POSIX_Keys_Key_value_pair *key_value_pair; - -key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); + if ( key_value_pair != NULL ) { value = key_value_pair->value; } else { value = NULL; diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c index 8b0f517..7034d8e 100644 --- a/cpukit/posix/src/keysetspecific.c +++ b/cpukit/posix/src/keysetspecific.c @@ -24,11 +24,11 @@ #include -static int _POSIX_Keys_Set_value( RBTree_Node *node, const void *value ) +static int _POSIX_Keys_Set_value( + POSIX_Keys_Key_value_pair *key_value_pair, + const void*value +) { - POSIX_Keys_Key_value_pair *key_value_pair; - - key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); key_value_pair->value = RTEMS_DECONST( void *, value ); return 0; @@ -91,16 +91,13 @@ static int _POSIX_Keys_Delete_value( the_key = _POSIX_Keys_Get( key ); if ( the_key != NULL ) { -ISR_lock_Context lock_context; -RBTree_Node *node; +POSIX_Keys_Key_value_pair *key_value_pair; +ISR_lock_Context lock_context; _POSIX_Keys_Key_value_acquire( executing, &lock_context ); -node = _POSIX_Keys_Key_value_find( key, executing ); -if ( node != NULL ) { - POSIX_Keys_Key_value_pair *key_value_pair; - - key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); +key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); +if ( key_value_pair != NULL ) { _RBTree_Extract( &executing->Keys.Key_value_pairs, &key_value_pair->Lookup_node @@ -138,14 +135,14 @@ int pthread_setspecific( executing = _Thread_Get_executing(); if ( value != NULL ) { -ISR_lock_Context lock_context; -RBTree_Node *node; +ISR_lock_Context lock_context; +POSIX_Keys_Key_value_pair *key_value_pair; _POSIX_Keys_Key_value_acquire( executing, &lock_context ); -node = _POSIX_Keys_Key_value_find( key, executing ); -if ( node != NULL ) { - eno = _POSIX_Keys_Set_value( node, value ); +key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); +if ( key_value_pair != NULL ) { + eno = _POSIX_Keys_Set_value( key_value_pair, value ); _POSIX_Keys_Key_value_release( executing, &lock_context ); } else { _POSIX_Keys_Key_value_release( executing, &lock_context ); diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h index 2057612..1d17365 100644 --- a/cpukit/score/include/rtems/score/rbtree.h +++ b/cpukit/score/include/rtems/score/rbtree.h @@ -532,15 +532,19 @@ RTEMS_INLINE_ROUTINE void _RBTree_Insert_inline( * node, otherwise false. * @param less Must return true if the specified key is less than the key of * the node, otherwise false. + * @param adjust In case a node is
[PATCH 07/15] rtems: Avoid Giant lock for partitions
Use an ISR lock to protect the partition state changes. Update #2555. --- cpukit/rtems/include/rtems/rtems/part.h | 3 ++ cpukit/rtems/include/rtems/rtems/partimpl.h | 73 ++--- cpukit/rtems/src/partcreate.c | 15 +++--- cpukit/rtems/src/partdelete.c | 16 --- cpukit/rtems/src/partgetbuffer.c| 23 + cpukit/rtems/src/partreturnbuffer.c | 34 -- 6 files changed, 97 insertions(+), 67 deletions(-) diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h index 7dd90a9..5b840cc 100644 --- a/cpukit/rtems/include/rtems/rtems/part.h +++ b/cpukit/rtems/include/rtems/rtems/part.h @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -55,6 +56,8 @@ extern "C" { typedef struct { /** This field is the object management portion of a Partition instance. */ Objects_Control Object; + /** This field is the lock of the Partition. */ + ISR_LOCK_MEMBER(Lock ) /** This field is the physical starting address of the Partition. */ void *starting_address; /** This field is the size of the Partition in bytes. */ diff --git a/cpukit/rtems/include/rtems/rtems/partimpl.h b/cpukit/rtems/include/rtems/rtems/partimpl.h index 472e06f..0ce7622 100644 --- a/cpukit/rtems/include/rtems/rtems/partimpl.h +++ b/cpukit/rtems/include/rtems/rtems/partimpl.h @@ -50,7 +50,7 @@ RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer ( Partition_Control *the_partition ) { - return _Chain_Get( &the_partition->Memory ); + return _Chain_Get_unprotected( &the_partition->Memory ); } /** @@ -63,7 +63,7 @@ RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Chain_Node*the_buffer ) { - _Chain_Append( &the_partition->Memory, the_buffer ); + _Chain_Append_unprotected( &the_partition->Memory, the_buffer ); } /** @@ -136,6 +136,37 @@ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); } +RTEMS_INLINE_ROUTINE void _Partition_Initialize( + Partition_Control *the_partition, + void *starting_address, + uint32_t length, + uint32_t buffer_size, + rtems_attributeattribute_set +) +{ + the_partition->starting_address = starting_address; + the_partition->length= length; + the_partition->buffer_size = buffer_size; + the_partition->attribute_set = attribute_set; + the_partition->number_of_used_blocks = 0; + + _Chain_Initialize( +&the_partition->Memory, +starting_address, +length / buffer_size, +buffer_size + ); + + _ISR_lock_Initialize( &the_partition->Lock, "Partition" ); +} + +RTEMS_INLINE_ROUTINE void _Partition_Destroy( + Partition_Control *the_partition +) +{ + _ISR_lock_Destroy( &the_partition->Lock ); +} + /** * @brief Frees a partition control block to the * inactive chain of free partition control blocks. @@ -150,24 +181,34 @@ RTEMS_INLINE_ROUTINE void _Partition_Free ( _Objects_Free( &_Partition_Information, &the_partition->Object ); } -/** - * @brief Maps partition IDs to partition control blocks. - * - * This function maps partition IDs to partition control blocks. - * If ID corresponds to a local partition, then it returns - * the_partition control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. If the partition ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_partition is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_partition is undefined. - */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, - Objects_Locations *location + Objects_Locations *location, + ISR_lock_Context *lock_context +) +{ + return (Partition_Control *) _Objects_Get_isr_disable( +&_Partition_Information, +id, +location, +lock_context + ); +} + +RTEMS_INLINE_ROUTINE void _Partition_Acquire_critical( + Partition_Control *the_partition, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Acquire( &the_partition->Lock, lock_context ); +} + +RTEMS_INLINE_ROUTINE void _Partition_Release( + Partition_Control *the_partition, + ISR_lock_Context *lock_context ) { - return (Partition_Control *) -_Objects_Get( &_Partition_Information, id, location ); + _ISR_lock_Release_and_ISR_enable( &the_partition->Lock, lock_context ); } /**@}*/ diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c index e3544e7..c058adf 100644 --- a/cpukit/rtems/src/partcreate.c +++ b/cpukit/rtems/src/partcreate.c @@ -94,14 +94,13 @@ rtems_status_code rtems_partition_create( } #endif - the_partition->starting_address = starting_address; - the_partition->length= length; - the_partition->buffer_size = buffer_size; - the_partition->attri
[PATCH 05/15] score: Use red-black tree for active MP proxies
Update #2555. --- cpukit/score/include/rtems/score/thread.h | 6 +- cpukit/score/include/rtems/score/threadmp.h | 29 + cpukit/score/src/threadmp.c | 162 +--- testsuites/sptests/spsize/size.c| 5 - 4 files changed, 106 insertions(+), 96 deletions(-) diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 7bb65e4..d9f1eb2 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -431,8 +431,10 @@ typedef struct { */ Objects_Id thread_queue_id; - /** This field is used to manage the set of proxies in the system. */ - Chain_Node Active; + /** + * @brief This field is used to manage the set of active proxies in the system. + */ + RBTree_Node Active; /** * @brief Provide thread queue heads for this thread proxy. diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h index d287780..5dc5c7e 100644 --- a/cpukit/score/include/rtems/score/threadmp.h +++ b/cpukit/score/include/rtems/score/threadmp.h @@ -69,27 +69,13 @@ Thread_Control *_Thread_MP_Allocate_proxy ( * id from the active chain of proxy control blocks. * * This function removes the proxy control block for the specified - * id from the active chain of proxy control blocks. + * id from the active red-black tree of proxy control blocks. */ Thread_Control *_Thread_MP_Find_proxy ( Objects_Id the_id ); /** - * @brief Manage the active set MP proxies. - * - * The following chain is used to manage the active set proxies. - */ -extern Chain_Control _Thread_MP_Active_proxies; - -/** - * @brief Manage the inactive set of MP proxies. - * - * The following chain is used to manage the inactive set of proxies. - */ -extern Chain_Control _Thread_MP_Inactive_proxies; - -/** * This function returns true if the thread in question is the * multiprocessing receive thread. * @@ -103,19 +89,8 @@ extern Chain_Control _Thread_MP_Inactive_proxies; * This routine frees a proxy control block to the * inactive chain of free proxy control blocks. */ +void _Thread_MP_Free_proxy( Thread_Control *the_thread ); -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 ); -} /**@}*/ diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c index 8ba4d49..5dd3e88 100644 --- a/cpukit/score/src/threadmp.c +++ b/cpukit/score/src/threadmp.c @@ -19,14 +19,26 @@ #endif #include -#include +#include #include #include -Chain_Control _Thread_MP_Active_proxies; +static RBTREE_DEFINE_EMPTY( _Thread_MP_Active_proxies ); -Chain_Control _Thread_MP_Inactive_proxies; +static CHAIN_DEFINE_EMPTY( _Thread_MP_Inactive_proxies ); + +ISR_LOCK_DEFINE( static, _Thread_MP_Proxies_lock, "Thread MP Proxies" ) + +static void _Thread_MP_Proxies_acquire( ISR_lock_Context *lock_context ) +{ + _ISR_lock_ISR_disable_and_acquire( &_Thread_MP_Proxies_lock, lock_context ); +} + +static void _Thread_MP_Proxies_release( ISR_lock_Context *lock_context ) +{ + _ISR_lock_Release_and_ISR_enable( &_Thread_MP_Proxies_lock, lock_context ); +} void _Thread_MP_Handler_initialization ( uint32_tmaximum_proxies @@ -37,10 +49,7 @@ void _Thread_MP_Handler_initialization ( char *proxies; uint32_t i; - _Chain_Initialize_empty( &_Thread_MP_Active_proxies ); - if ( maximum_proxies == 0 ) { -_Chain_Initialize_empty( &_Thread_MP_Inactive_proxies ); return; } @@ -69,30 +78,67 @@ void _Thread_MP_Handler_initialization ( } } +#define THREAD_MP_PROXY_OF_ACTIVE_NODE( the_node ) \ + RTEMS_CONTAINER_OF( the_node, Thread_Proxy_control, Active ) + +static bool _Thread_MP_Proxy_equal( + const void*left, + const RBTree_Node *right +) +{ + const Objects_Id *the_left; + const Thread_Proxy_control *the_right; + + the_left = left; + the_right = THREAD_MP_PROXY_OF_ACTIVE_NODE( right ); + + return *the_left == the_right->Object.id; +} + +static bool _Thread_MP_Proxy_less( + const void*left, + const RBTree_Node *right +) +{ + const Objects_Id *the_left; + const Thread_Proxy_control *the_right; + + the_left = left; + the_right = THREAD_MP_PROXY_OF_ACTIVE_NODE( right ); + + return *the_left < the_right->Object.id; +} + +static void *_Thread_MP_Proxy_adjust( RBTree_Node *node ) +{ + return THREAD_MP_PROXY_OF_ACTIVE_NODE( node ); +} + Thread_Control *_Thread_MP_Allocate_proxy ( States_Control the_state ) { - Thread_Control *the_thread; Thread_Proxy_control *the_proxy; + ISR_lock_Context lock_context; - the_thread = (Thread_Control *)_Chain_Get( &_Thread_MP_Inactive_prox
[PATCH 10/15] score: Delete _Chain_Prepend_with_empty_check()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 10 --- cpukit/sapi/src/chainprotected.c | 4 +-- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/chainimpl.h | 19 cpukit/score/src/chainprependempty.c | 44 5 files changed, 3 insertions(+), 76 deletions(-) delete mode 100644 cpukit/score/src/chainprependempty.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 01d743f..887623b 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -763,20 +763,10 @@ bool rtems_chain_append_with_empty_check( * @retval true The chain was empty before the prepend. * @retval false The chain contained at least one node before the prepend. */ -#if defined( RTEMS_SMP ) bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ); -#else -RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check( - rtems_chain_control *chain, - rtems_chain_node *node -) -{ - return _Chain_Prepend_with_empty_check( chain, node ); -} -#endif /** * @brief Tries to get the first @a node and check if the @a chain is empty diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index 51842f4..087c8e7 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -104,8 +104,6 @@ bool rtems_chain_append_with_empty_check( return was_empty; } -#if defined( RTEMS_SMP ) - bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node @@ -121,6 +119,8 @@ bool rtems_chain_prepend_with_empty_check( return was_empty; } +#if defined( RTEMS_SMP ) + bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 93490dc..914fa3a 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -347,7 +347,7 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ src/chainextract.c src/chainget.c src/chaininsert.c \ -src/chainprependempty.c src/chaingetempty.c \ +src/chaingetempty.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index 4153107..f23fab8 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -145,25 +145,6 @@ void _Chain_Append( ); /** - * @brief Prepend a node and check if the chain was empty before. - * - * This routine prepends the_node onto the front of the_chain. - * - * @param[in] the_chain is the chain to be operated upon. - * @param[in] the_node is the node to be prepended. - * - * @note It disables interrupts to ensure the atomicity of the append - * operation. - * - * @retval true The chain was empty before. - * @retval false The chain contained at least one node before. - */ -bool _Chain_Prepend_with_empty_check( - Chain_Control *the_chain, - Chain_Node*the_node -); - -/** * @brief Get the first node and check if the chain is empty afterwards. * * This function removes the first node from the_chain and returns diff --git a/cpukit/score/src/chainprependempty.c b/cpukit/score/src/chainprependempty.c deleted file mode 100644 index f83d628..000 --- a/cpukit/score/src/chainprependempty.c +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file - * - * @ingroup ScoreChain - * - * @brief _Chain_Prepend_with_empty_check() implementation. - */ - -/* - * Copyright (c) 2010 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -bool _Chain_Prepend_with_empty_check( - Chain_Control *chain, - Chain_Node *node -) -{ - ISR_Level level; - bool was_empty; - - _ISR_Disable( level ); - was_empty = _Chain_Prepend_with_empty_check_unprotected( chain, node ); - _ISR_Enable( level ); - - return was_empty; -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 11/15] score: Delete _Chain_Get_with_empty_check()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 10 --- cpukit/sapi/src/chainprotected.c | 4 --- cpukit/score/Makefile.am | 1 - cpukit/score/include/rtems/score/chainimpl.h | 25 cpukit/score/src/chaingetempty.c | 44 5 files changed, 84 deletions(-) delete mode 100644 cpukit/score/src/chaingetempty.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 887623b..f776890 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -780,20 +780,10 @@ bool rtems_chain_prepend_with_empty_check( * @retval true The chain is empty after the node removal. * @retval false The chain contained at least one node after the node removal. */ -#if defined( RTEMS_SMP ) bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node ); -#else -RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check( - rtems_chain_control *chain, - rtems_chain_node **node -) -{ - return _Chain_Get_with_empty_check( chain, node ); -} -#endif /** * @brief Returns the node count of the chain. diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index 087c8e7..3d59348 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -119,8 +119,6 @@ bool rtems_chain_prepend_with_empty_check( return was_empty; } -#if defined( RTEMS_SMP ) - bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node @@ -135,5 +133,3 @@ bool rtems_chain_get_with_empty_check( return is_empty_now; } - -#endif /* defined( RTEMS_SMP ) */ diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 914fa3a..fa789d1 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -347,7 +347,6 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ src/chainextract.c src/chainget.c src/chaininsert.c \ -src/chaingetempty.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index f23fab8..fa9a046 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -145,31 +145,6 @@ void _Chain_Append( ); /** - * @brief Get the first node and check if the chain is empty afterwards. - * - * This function removes the first node from the_chain and returns - * a pointer to that node in @a the_node. If the_chain is empty, then NULL is - * returned. - * - * @param[in] the_chain is the chain to attempt to get the first node from. - * @param[out] the_node is the first node on the chain or NULL if the chain is - * empty. - * - * @note It disables interrupts to ensure the atomicity of the append - * operation. - * - * @retval true The chain is empty now. - * @retval false The chain contains at least one node now. - * - * - INTERRUPT LATENCY: - *+ single case - */ -bool _Chain_Get_with_empty_check( - Chain_Control *the_chain, - Chain_Node **the_node -); - -/** * @brief Returns the node count of the chain. * * @param[in] chain The chain. diff --git a/cpukit/score/src/chaingetempty.c b/cpukit/score/src/chaingetempty.c deleted file mode 100644 index 1efec77..000 --- a/cpukit/score/src/chaingetempty.c +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file - * - * @ingroup ScoreChain - * - * @brief _Chain_Get_with_empty_check() implementation. - */ - -/* - * Copyright (c) 2010 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -bool _Chain_Get_with_empty_check( - Chain_Control *chain, - Chain_Node **node -) -{ - ISR_Level level; - bool is_empty_now; - - _ISR_Disable( level ); - is_empty_now = _Chain_Get_with_empty_check_unprotected( chain, node ); - _ISR_Enable( level ); - - return is_empty_now; -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 15/15] score: Delete _Chain_Append()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 10 -- cpukit/sapi/src/chainprotected.c | 4 --- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/chainimpl.h | 13 --- cpukit/score/src/chainappend.c | 51 5 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 cpukit/score/src/chainappend.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index d925444..3d8a860 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -648,20 +648,10 @@ RTEMS_INLINE_ROUTINE void rtems_chain_insert_unprotected( * NOTE: It disables interrupts to ensure the atomicity of the * append operation. */ -#if defined( RTEMS_SMP ) void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node*the_node ); -#else -RTEMS_INLINE_ROUTINE void rtems_chain_append( - rtems_chain_control *the_chain, - rtems_chain_node*the_node -) -{ - _Chain_Append( the_chain, the_node ); -} -#endif /** * @brief Append a node on the end of a chain (unprotected). diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index 0135666..868e3d8 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -61,8 +61,6 @@ void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) chain_release( &lock_context ); } -#if defined( RTEMS_SMP ) - void rtems_chain_append( rtems_chain_control *chain, rtems_chain_node *node @@ -75,8 +73,6 @@ void rtems_chain_append( chain_release( &lock_context ); } -#endif /* defined( RTEMS_SMP ) */ - void rtems_chain_prepend( rtems_chain_control *chain, rtems_chain_node *node diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 403508d..455c99d 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -345,7 +345,7 @@ libscore_a_SOURCES += src/userextaddset.c \ src/userext.c src/userextremoveset.c src/userextiterate.c ## STD_C_FILES -libscore_a_SOURCES += src/chain.c src/chainappend.c \ +libscore_a_SOURCES += src/chain.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index 166b58b..ff66d46 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -80,19 +80,6 @@ void _Chain_Initialize( ); /** - * @brief Append a node on the end of a chain. - * - * This routine appends @a the_node onto the end of @a the_chain. - * - * @note It disables interrupts to ensure the atomicity of the - * append operation. - */ -void _Chain_Append( - Chain_Control *the_chain, - Chain_Node*the_node -); - -/** * @brief Returns the node count of the chain. * * @param[in] chain The chain. diff --git a/cpukit/score/src/chainappend.c b/cpukit/score/src/chainappend.c deleted file mode 100644 index 09c66ec..000 --- a/cpukit/score/src/chainappend.c +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file - * - * @brief Append a Node on the End of a Chain - * @ingroup ScoreChain -*/ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -/* - * _Chain_Append - * - * This kernel routine puts a node on the end of the specified chain. - * - * Input parameters: - *the_chain - pointer to chain header - *node - address of node to put at rear of chain - * - * Output parameters: NONE - * - * INTERRUPT LATENCY: - *only case - */ - -void _Chain_Append( - Chain_Control *the_chain, - Chain_Node*node -) -{ - ISR_Level level; - - _ISR_Disable( level ); -_Chain_Append_unprotected( the_chain, node ); - _ISR_Enable( level ); -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 13/15] score: Delete _Chain_Extract()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 9 --- cpukit/sapi/src/chainprotected.c | 4 ++-- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/chainimpl.h | 15 cpukit/score/src/chainextract.c | 36 5 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 cpukit/score/src/chainextract.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 81f07b8..4bbdd53 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -560,18 +560,9 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_tail( * * @arg the_node specifies the node to extract */ -#if defined( RTEMS_SMP ) void rtems_chain_extract( rtems_chain_node *the_node ); -#else -RTEMS_INLINE_ROUTINE void rtems_chain_extract( - rtems_chain_node *the_node -) -{ - _Chain_Extract( the_node ); -} -#endif /** * @brief Extract the specified node from a chain (unprotected). diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index df7a71c..e3ae7fd 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -31,8 +31,6 @@ static void chain_release( rtems_interrupt_lock_context *lock_context ) rtems_interrupt_lock_release( &chain_lock, lock_context ); } -#if defined( RTEMS_SMP ) - void rtems_chain_extract( rtems_chain_node *node ) { rtems_interrupt_lock_context lock_context; @@ -42,6 +40,8 @@ void rtems_chain_extract( rtems_chain_node *node ) chain_release( &lock_context ); } +#if defined( RTEMS_SMP ) + rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) { rtems_chain_node *node; diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index e9d8cd9..6b4afdf 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -346,7 +346,7 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ -src/chainextract.c src/chainget.c \ +src/chainget.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index aee5307..40f9fd1 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -80,21 +80,6 @@ void _Chain_Initialize( ); /** - * @brief Extract the specified node from a chain. - * - * This routine extracts @a the_node from the chain on which it resides. - * It disables interrupts to ensure the atomicity of the extract operation. - * - * @param[in] the_node is the node to be extracted - * - * - INTERRUPT LATENCY: - *+ single case - */ -void _Chain_Extract( - Chain_Node *the_node -); - -/** * @brief Obtain the first node on a chain. * * This function removes the first node from @a the_chain and returns diff --git a/cpukit/score/src/chainextract.c b/cpukit/score/src/chainextract.c deleted file mode 100644 index e83af72..000 --- a/cpukit/score/src/chainextract.c +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file - * - * @brief Extracts a Node from a Chain - * - * @ingroup ScoreChain - */ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -void _Chain_Extract( - Chain_Node *node -) -{ - ISR_Level level; - - _ISR_Disable( level ); -_Chain_Extract_unprotected( node ); - _ISR_Enable( level ); -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 12/15] score: Delete _Chain_Insert()
This function is not used in the score. Update #2555. --- cpukit/sapi/include/rtems/chain.h| 10 -- cpukit/sapi/src/chainprotected.c | 4 +++ cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/chainimpl.h | 21 --- cpukit/score/src/chaininsert.c | 53 5 files changed, 5 insertions(+), 85 deletions(-) delete mode 100644 cpukit/score/src/chaininsert.c diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index f776890..81f07b8 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -642,20 +642,10 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get_first_unprotected( * NOTE: It disables interrupts to ensure the atomicity * of the extract operation. */ -#if defined( RTEMS_SMP ) void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ); -#else -RTEMS_INLINE_ROUTINE void rtems_chain_insert( - rtems_chain_node *after_node, - rtems_chain_node *the_node -) -{ - _Chain_Insert( after_node, the_node ); -} -#endif /** * @brief See _Chain_Insert_unprotected(). diff --git a/cpukit/sapi/src/chainprotected.c b/cpukit/sapi/src/chainprotected.c index 3d59348..df7a71c 100644 --- a/cpukit/sapi/src/chainprotected.c +++ b/cpukit/sapi/src/chainprotected.c @@ -54,6 +54,8 @@ rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) return node; } +#endif /* defined( RTEMS_SMP ) */ + void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) { rtems_interrupt_lock_context lock_context; @@ -63,6 +65,8 @@ void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) chain_release( &lock_context ); } +#if defined( RTEMS_SMP ) + void rtems_chain_append( rtems_chain_control *chain, rtems_chain_node *node diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index fa789d1..e9d8cd9 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -346,7 +346,7 @@ libscore_a_SOURCES += src/userextaddset.c \ ## STD_C_FILES libscore_a_SOURCES += src/chain.c src/chainappend.c \ -src/chainextract.c src/chainget.c src/chaininsert.c \ +src/chainextract.c src/chainget.c \ src/chainnodecount.c \ src/debugisthreaddispatchingallowed.c \ src/interr.c src/isr.c src/wkspace.c src/wkstringduplicate.c diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h index fa9a046..aee5307 100644 --- a/cpukit/score/include/rtems/score/chainimpl.h +++ b/cpukit/score/include/rtems/score/chainimpl.h @@ -111,27 +111,6 @@ Chain_Node *_Chain_Get( ); /** - * @brief Insert a node on a chain. - * - * This routine inserts @a the_node on a chain immediately following - * @a after_node. - * - * @param[in] after_node is the pointer to the node in chain to be - * inserted after - * @param[in] the_node is the pointer to the node to be inserted - * - * @note It disables interrupts to ensure the atomicity - * of the insert operation. - * - * - INTERRUPT LATENCY: - *+ single case - */ -void _Chain_Insert( - Chain_Node *after_node, - Chain_Node *the_node -); - -/** * @brief Append a node on the end of a chain. * * This routine appends @a the_node onto the end of @a the_chain. diff --git a/cpukit/score/src/chaininsert.c b/cpukit/score/src/chaininsert.c deleted file mode 100644 index 3a012ec..000 --- a/cpukit/score/src/chaininsert.c +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file - * - * @brief Extracts a node from a given chain - * - * @ingroup ScoreChain - */ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -/* - * _Chain_Insert - * - * This kernel routine inserts a given node after a specified node - * a requested chain. - * - * Input parameters: - *after_node - pointer to node in chain to be inserted after - *node - pointer to node to be inserted - * - * Output parameters: NONE - * - * INTERRUPT LATENCY: - *only case - */ - -void _Chain_Insert( - Chain_Node *after_node, - Chain_Node *node -) -{ - ISR_Level level; - - _ISR_Disable( level ); -_Chain_Insert_unprotected( after_node, node ); - _ISR_Enable( level ); -} -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] cpukit: pppd: fix compile warning
This should be fine. I don't know, does pppd have an active maintainer? On Tue, Apr 5, 2016 at 8:45 AM, Peng Fan wrote: > rcsid is defined, but not used. So discard it. > > Signed-off-by: Peng Fan > --- > cpukit/pppd/auth.c | 4 > cpukit/pppd/ccp.c | 4 > cpukit/pppd/chap.c | 4 > cpukit/pppd/demand.c| 4 > cpukit/pppd/fsm.c | 4 > cpukit/pppd/ipcp.c | 4 > cpukit/pppd/lcp.c | 4 > cpukit/pppd/magic.c | 4 > cpukit/pppd/options.c | 4 > cpukit/pppd/rtemsmain.c | 4 > cpukit/pppd/sys-rtems.c | 5 - > cpukit/pppd/upap.c | 4 > cpukit/pppd/utils.c | 4 > 13 files changed, 53 deletions(-) > > diff --git a/cpukit/pppd/auth.c b/cpukit/pppd/auth.c > index fb84f1e..9df1d32 100644 > --- a/cpukit/pppd/auth.c > +++ b/cpukit/pppd/auth.c > @@ -32,8 +32,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > #include > #include > #include > @@ -75,8 +73,6 @@ > #endif > #include "pathnames.h" > > -static const char rcsid[] = RCSID; > - > /* The name by which the peer authenticated itself to us. */ > char peer_authname[MAXNAMELEN]; > > diff --git a/cpukit/pppd/ccp.c b/cpukit/pppd/ccp.c > index d80df27..6ada96c 100644 > --- a/cpukit/pppd/ccp.c > +++ b/cpukit/pppd/ccp.c > @@ -25,8 +25,6 @@ > * OR MODIFICATIONS. > */ > > -#define RCSID "$Id$" > - > #include > #include > > @@ -35,8 +33,6 @@ > #include "ccp.h" > #include > > -static const char rcsid[] = RCSID; > - > /* > * Command-line options. > */ > diff --git a/cpukit/pppd/chap.c b/cpukit/pppd/chap.c > index 3fe766f..55f1896 100644 > --- a/cpukit/pppd/chap.c > +++ b/cpukit/pppd/chap.c > @@ -33,8 +33,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > /* > * TODO: > */ > @@ -52,8 +50,6 @@ > #include "chap_ms.h" > #endif > > -static const char rcsid[] = RCSID; > - > /* > * Command-line options. > */ > diff --git a/cpukit/pppd/demand.c b/cpukit/pppd/demand.c > index a094a15..a5c13f7 100644 > --- a/cpukit/pppd/demand.c > +++ b/cpukit/pppd/demand.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$"; > - > #include > #include > #include > @@ -43,8 +41,6 @@ > #include "ipcp.h" > #include "lcp.h" > > -static const char rcsid[] = RCSID; > - > static unsigned char *frame; > static int framelen; > static int framemax; > diff --git a/cpukit/pppd/fsm.c b/cpukit/pppd/fsm.c > index ce06401..4ff17d8 100644 > --- a/cpukit/pppd/fsm.c > +++ b/cpukit/pppd/fsm.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > /* > * TODO: > * Randomize fsm id on link/init. > @@ -32,8 +30,6 @@ > #include "pppd.h" > #include "fsm.h" > > -static const char rcsid[] = RCSID; > - > static void fsm_timeout(void *); > static void fsm_rconfreq(fsm *, u_char, u_char *, int); > static void fsm_rconfack(fsm *, int, u_char *, int); > diff --git a/cpukit/pppd/ipcp.c b/cpukit/pppd/ipcp.c > index fd23ddd..a9a8f24 100644 > --- a/cpukit/pppd/ipcp.c > +++ b/cpukit/pppd/ipcp.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > /* > * TODO: > */ > @@ -40,8 +38,6 @@ > > #include > > -static const char rcsid[] = RCSID; > - > /* global vars */ > ipcp_options ipcp_wantoptions[NUM_PPP];/* Options that we want to > request */ > ipcp_options ipcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ > diff --git a/cpukit/pppd/lcp.c b/cpukit/pppd/lcp.c > index 9da1326..e09e8fb 100644 > --- a/cpukit/pppd/lcp.c > +++ b/cpukit/pppd/lcp.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$"; > - > /* > * TODO: > */ > @@ -33,8 +31,6 @@ > #include "chap.h" > #include "magic.h" > > -static const char rcsid[] = RCSID; > - > /* > * LCP-related command-line options. > */ > diff --git a/cpukit/pppd/magic.c b/cpukit/pppd/magic.c > index 3d297e5..46add2f 100644 > --- a/cpukit/pppd/magic.c > +++ b/cpukit/pppd/magic.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > #include > #include > #include > @@ -28,8 +26,6 @@ > #include "pppd.h" > #include "magic.h" > > -static const char rcsid[] = RCSID; > - > /* > * magic_init - Initialize the magic number generator. > * > diff --git a/cpukit/pppd/options.c b/cpukit/pppd/options.c > index 8a39266..9086e55 100644 > --- a/cpukit/pppd/options.c > +++ b/cpukit/pppd/options.c > @@ -17,8 +17,6 @@ > * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. > */ > > -#define RCSID "$Id$" > - > #include > #include > #include > @@ -53,8 +51,6 @@ > > #inclu
Re: [PATCH 06/15] score: Use red-black tree for active global objects
- Gedare Bloom schrieb: > Generally ok. I have a question and comment. > > Would it make sense to unify the object management and use an rbtree > in the uni/smp cases too? You mean for Object_Control objects? No, this would be a performance problem I guess if you do a tree lookup each time you do a semaphore obtain/release instead of the table lookup. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber at embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 04/15] score: Add node adjust to _RBTree_Find_inline()
- Gedare Bloom schrieb: > I don't understand the name "adjust"? I think of adjusting as > something that would cause a change or modify, which is not the case > here. I don't have any great replacement, but I guess I might suggest > "dereference"? You may adjust the pointer value, e.g. node + offset. Dereference is wrong, since you are not supposed to do a *node. Maybe "fixup"? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber at embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Error while building arm/realview_pbx_a9_qemu BSP
Hello, I am trying to build arm/realview_pbx_a9_qemu with waf. ( https://git.rtems.org/rtems-libbsd/tree/README.waf ) In the last step, it shows the *following error:* Build failed -> task in 'bsd' failed (exit status 1): *A part error trace: * /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h: In function 'rtems_bsd_mutex_init': /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:60:38: error: 'THREAD_QUEUE_DISCIPLINE_PRIORITY' undeclared (first use in this function) _Thread_queue_Initialize(&m->queue, THREAD_QUEUE_DISCIPLINE_PRIORITY); ^~~~ Can anyone help me with this ? Regards, Deval Shah ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 04/15] score: Add node adjust to _RBTree_Find_inline()
Maybe "map"? - Gedare Bloom schrieb: > On Tue, Apr 5, 2016 at 11:35 AM, Sebastian Huber > wrote: > > > > - Gedare Bloom schrieb: > >> I don't understand the name "adjust"? I think of adjusting as > >> something that would cause a change or modify, which is not the case > >> here. I don't have any great replacement, but I guess I might suggest > >> "dereference"? > > > > You may adjust the pointer value, e.g. node + offset. Dereference is > > wrong, since you are not supposed to do a *node. Maybe "fixup"? > > > As I understand it, this callout does not modify the tree or node, so > I would avoid using any verb that implies a change happens: fixup > implies some modification to me. Perhaps I misunderstood, but the > comment says the callout should "get the return value" of a found > node. get_value() would be OK except for slight overload with POSIX > keys. read()? > > I'm not coming up with any great ideas. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber at embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 04/15] score: Add node adjust to _RBTree_Find_inline()
I don't understand the name "adjust"? I think of adjusting as something that would cause a change or modify, which is not the case here. I don't have any great replacement, but I guess I might suggest "dereference"? On Tue, Apr 5, 2016 at 9:09 AM, Sebastian Huber wrote: > --- > cpukit/posix/include/rtems/posix/keyimpl.h | 14 ++ > cpukit/posix/src/keygetspecific.c | 15 ++- > cpukit/posix/src/keysetspecific.c | 29 + > cpukit/score/include/rtems/score/rbtree.h | 12 > 4 files changed, 37 insertions(+), 33 deletions(-) > > diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h > b/cpukit/posix/include/rtems/posix/keyimpl.h > index 7095a16..a534b7e 100644 > --- a/cpukit/posix/include/rtems/posix/keyimpl.h > +++ b/cpukit/posix/include/rtems/posix/keyimpl.h > @@ -139,16 +139,22 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_less( >return *the_left < the_right->key; > } > > -RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Key_value_find( > - pthread_key_t key, > - Thread_Control *the_thread > +RTEMS_INLINE_ROUTINE void *_POSIX_Keys_Key_value_adjust( RBTree_Node *node ) > +{ > + return POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); > +} > + > +RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair *_POSIX_Keys_Key_value_find( > + pthread_key_t key, > + Thread_Control *the_thread > ) > { >return _RBTree_Find_inline( > &the_thread->Keys.Key_value_pairs, > &key, > _POSIX_Keys_Key_value_equal, > -_POSIX_Keys_Key_value_less > +_POSIX_Keys_Key_value_less, > +_POSIX_Keys_Key_value_adjust >); > } > > diff --git a/cpukit/posix/src/keygetspecific.c > b/cpukit/posix/src/keygetspecific.c > index 08ac1ed..ae29955 100644 > --- a/cpukit/posix/src/keygetspecific.c > +++ b/cpukit/posix/src/keygetspecific.c > @@ -30,20 +30,17 @@ void *pthread_getspecific( >pthread_key_t key > ) > { > - Thread_Control *executing; > - ISR_lock_Context lock_context; > - RBTree_Node *node; > - void *value; > + Thread_Control*executing; > + ISR_lock_Context lock_context; > + POSIX_Keys_Key_value_pair *key_value_pair; > + void *value; > >executing = _Thread_Get_executing(); >_POSIX_Keys_Key_value_acquire( executing, &lock_context ); > > - node = _POSIX_Keys_Key_value_find( key, executing ); > + key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); > > - if ( node != NULL ) { > -POSIX_Keys_Key_value_pair *key_value_pair; > - > -key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); > + if ( key_value_pair != NULL ) { > value = key_value_pair->value; >} else { > value = NULL; > diff --git a/cpukit/posix/src/keysetspecific.c > b/cpukit/posix/src/keysetspecific.c > index 8b0f517..7034d8e 100644 > --- a/cpukit/posix/src/keysetspecific.c > +++ b/cpukit/posix/src/keysetspecific.c > @@ -24,11 +24,11 @@ > > #include > > -static int _POSIX_Keys_Set_value( RBTree_Node *node, const void *value ) > +static int _POSIX_Keys_Set_value( > + POSIX_Keys_Key_value_pair *key_value_pair, > + const void*value > +) > { > - POSIX_Keys_Key_value_pair *key_value_pair; > - > - key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); >key_value_pair->value = RTEMS_DECONST( void *, value ); > >return 0; > @@ -91,16 +91,13 @@ static int _POSIX_Keys_Delete_value( > >the_key = _POSIX_Keys_Get( key ); >if ( the_key != NULL ) { > -ISR_lock_Context lock_context; > -RBTree_Node *node; > +POSIX_Keys_Key_value_pair *key_value_pair; > +ISR_lock_Context lock_context; > > _POSIX_Keys_Key_value_acquire( executing, &lock_context ); > > -node = _POSIX_Keys_Key_value_find( key, executing ); > -if ( node != NULL ) { > - POSIX_Keys_Key_value_pair *key_value_pair; > - > - key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node ); > +key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); > +if ( key_value_pair != NULL ) { >_RBTree_Extract( > &executing->Keys.Key_value_pairs, > &key_value_pair->Lookup_node > @@ -138,14 +135,14 @@ int pthread_setspecific( >executing = _Thread_Get_executing(); > >if ( value != NULL ) { > -ISR_lock_Context lock_context; > -RBTree_Node *node; > +ISR_lock_Context lock_context; > +POSIX_Keys_Key_value_pair *key_value_pair; > > _POSIX_Keys_Key_value_acquire( executing, &lock_context ); > > -node = _POSIX_Keys_Key_value_find( key, executing ); > -if ( node != NULL ) { > - eno = _POSIX_Keys_Set_value( node, value ); > +key_value_pair = _POSIX_Keys_Key_value_find( key, executing ); > +if ( key_value_pair != NULL ) { > + eno = _POSIX_Keys_Set_value( key_value_pair, value ); >_POSIX_Keys_Key_value_release( executing, &lock_context ); > } else { >_POSIX_Keys_Key_value_