From 620b23ece54a0bb43189bb9c0f14adf447cbafe6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 24 Nov 2016 06:13:11 +0100 Subject: score: Optimize _Thread_queue_Enqueue() Move thread state for _Thread_queue_Enqueue() to the thread queue context. This reduces the parameter count of _Thread_queue_Enqueue() from five to four (ARM for example has only four function parameter registers). Since the thread state is used after several function calls inside _Thread_queue_Enqueue() this parameter was saved on the stack previously. --- cpukit/score/src/condition.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/condition.c') diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c index aaf2f4bd67..ea363169fe 100644 --- a/cpukit/score/src/condition.c +++ b/cpukit/score/src/condition.c @@ -109,6 +109,10 @@ static Thread_Control *_Condition_Do_wait( context->mutex = _mutex; condition = _Condition_Get( _condition ); executing = _Condition_Queue_acquire_critical( condition, &context->Base ); + _Thread_queue_Context_set_thread_state( + &context->Base, + STATES_WAITING_FOR_SYS_LOCK_CONDITION + ); _Thread_queue_Context_set_enqueue_callout( &context->Base, _Condition_Enqueue_callout @@ -117,7 +121,6 @@ static Thread_Control *_Condition_Do_wait( &condition->Queue.Queue, CONDITION_TQ_OPERATIONS, executing, - STATES_WAITING_FOR_SYS_LOCK_CONDITION, &context->Base ); -- cgit v1.2.3