summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-31 09:13:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:45 +0100
commit63e2ca1b8b0a651a733d4ac3e0517397d0681214 (patch)
tree327686940bb25d42f42c83d4b73b8890f7e52ad6
parent2dd098a6359d9df132da09201ea0506c5389dc80 (diff)
score: Simplify yield and unblock scheduler ops
Update #2556.
-rw-r--r--cpukit/score/include/rtems/score/scheduler.h12
-rw-r--r--cpukit/score/include/rtems/score/schedulercbs.h2
-rw-r--r--cpukit/score/include/rtems/score/scheduleredf.h4
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h8
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriority.h4
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h2
-rw-r--r--cpukit/score/include/rtems/score/schedulerprioritysmp.h4
-rw-r--r--cpukit/score/include/rtems/score/schedulersimple.h4
-rw-r--r--cpukit/score/include/rtems/score/schedulersimplesmp.h4
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h115
-rw-r--r--cpukit/score/include/rtems/score/schedulerstrongapa.h4
-rw-r--r--cpukit/score/src/schedulercbsunblock.c4
-rw-r--r--cpukit/score/src/scheduleredfunblock.c4
-rw-r--r--cpukit/score/src/scheduleredfyield.c4
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c27
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c26
-rw-r--r--cpukit/score/src/schedulerpriorityunblock.c4
-rw-r--r--cpukit/score/src/schedulerpriorityyield.c4
-rw-r--r--cpukit/score/src/schedulersimplesmp.c26
-rw-r--r--cpukit/score/src/schedulersimpleunblock.c4
-rw-r--r--cpukit/score/src/schedulersimpleyield.c4
-rw-r--r--cpukit/score/src/schedulerstrongapa.c26
-rw-r--r--testsuites/smptests/smpscheduler03/init.c40
23 files changed, 141 insertions, 195 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index c34ceed914..873dabc7ca 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -43,13 +43,13 @@ struct Per_CPU_Control;
typedef struct Scheduler_Control Scheduler_Control;
#if defined(RTEMS_SMP)
- typedef Thread_Control * Scheduler_Void_or_thread;
+ typedef bool Scheduler_Void_or_bool;
- #define SCHEDULER_RETURN_VOID_OR_NULL return NULL
+ #define SCHEDULER_RETURN_VOID_OR_BOOL return false
#else
- typedef void Scheduler_Void_or_thread;
+ typedef void Scheduler_Void_or_bool;
- #define SCHEDULER_RETURN_VOID_OR_NULL return
+ #define SCHEDULER_RETURN_VOID_OR_BOOL return
#endif
/**
@@ -63,7 +63,7 @@ typedef struct {
void ( *schedule )( const Scheduler_Control *, Thread_Control *);
/** @see _Scheduler_Yield() */
- Scheduler_Void_or_thread ( *yield )(
+ Scheduler_Void_or_bool ( *yield )(
const Scheduler_Control *,
Thread_Control *,
Scheduler_Node *
@@ -77,7 +77,7 @@ typedef struct {
);
/** @see _Scheduler_Unblock() */
- Scheduler_Void_or_thread ( *unblock )(
+ Scheduler_Void_or_bool ( *unblock )(
const Scheduler_Control *,
Thread_Control *,
Scheduler_Node *
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index ee8e40d399..e56747bdc5 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -146,7 +146,7 @@ typedef struct {
*/
extern Scheduler_CBS_Server _Scheduler_CBS_Server_list[];
-Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
+Scheduler_Void_or_bool _Scheduler_CBS_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h
index f6bf2e5372..9fc2eb9ea3 100644
--- a/cpukit/score/include/rtems/score/scheduleredf.h
+++ b/cpukit/score/include/rtems/score/scheduleredf.h
@@ -144,7 +144,7 @@ void _Scheduler_EDF_Node_initialize(
Priority_Control priority
);
-Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
+Scheduler_Void_or_bool _Scheduler_EDF_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -166,7 +166,7 @@ Priority_Control _Scheduler_EDF_Unmap_priority(
Priority_Control priority
);
-Scheduler_Void_or_thread _Scheduler_EDF_Yield(
+Scheduler_Void_or_bool _Scheduler_EDF_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 5ef60e646e..64c2c3ad28 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -175,7 +175,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
Scheduler_Node *scheduler_node;
const Scheduler_Control *scheduler;
ISR_lock_Context lock_context;
- Thread_Control *needs_help;
+ bool needs_help;
node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
@@ -191,7 +191,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
);
_Scheduler_Release_critical( scheduler, &lock_context );
- if ( needs_help != the_thread ) {
+ if ( !needs_help ) {
return;
}
@@ -309,7 +309,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
Scheduler_Node *scheduler_node;
const Scheduler_Control *scheduler;
ISR_lock_Context lock_context;
- Thread_Control *needs_help;
+ bool needs_help;
node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
@@ -325,7 +325,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
);
_Scheduler_Release_critical( scheduler, &lock_context );
- if ( needs_help != the_thread ) {
+ if ( !needs_help ) {
return;
}
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index d0d6a862b7..91ebb3852a 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -128,7 +128,7 @@ void _Scheduler_priority_Schedule(
Thread_Control *the_thread
);
-Scheduler_Void_or_thread _Scheduler_priority_Unblock(
+Scheduler_Void_or_bool _Scheduler_priority_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -147,7 +147,7 @@ void _Scheduler_priority_Node_initialize(
Priority_Control priority
);
-Scheduler_Void_or_thread _Scheduler_priority_Yield(
+Scheduler_Void_or_bool _Scheduler_priority_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index 73f985cf2c..4c5b8bb1a2 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -94,7 +94,7 @@ void _Scheduler_priority_affinity_SMP_Block(
Scheduler_Node *node
);
-Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
+bool _Scheduler_priority_affinity_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index da0dc06b2c..b5fdec4021 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -113,7 +113,7 @@ void _Scheduler_priority_SMP_Block(
Scheduler_Node *node
);
-Thread_Control *_Scheduler_priority_SMP_Unblock(
+bool _Scheduler_priority_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
@@ -144,7 +144,7 @@ void _Scheduler_priority_SMP_Withdraw_node(
Thread_Scheduler_state next_state
);
-Thread_Control *_Scheduler_priority_SMP_Yield(
+bool _Scheduler_priority_SMP_Yield(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h
index 0f340bd71e..1d97e1cd7d 100644
--- a/cpukit/score/include/rtems/score/schedulersimple.h
+++ b/cpukit/score/include/rtems/score/schedulersimple.h
@@ -92,7 +92,7 @@ void _Scheduler_simple_Schedule(
Thread_Control *the_thread
);
-Scheduler_Void_or_thread _Scheduler_simple_Yield(
+Scheduler_Void_or_bool _Scheduler_simple_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -104,7 +104,7 @@ void _Scheduler_simple_Block(
Scheduler_Node *node
);
-Scheduler_Void_or_thread _Scheduler_simple_Unblock(
+Scheduler_Void_or_bool _Scheduler_simple_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index a0331fb4ff..a242325dbd 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -96,7 +96,7 @@ void _Scheduler_simple_SMP_Block(
Scheduler_Node *node
);
-Thread_Control *_Scheduler_simple_SMP_Unblock(
+bool _Scheduler_simple_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
@@ -127,7 +127,7 @@ void _Scheduler_simple_SMP_Withdraw_node(
Thread_Scheduler_state next_state
);
-Thread_Control *_Scheduler_simple_SMP_Yield(
+bool _Scheduler_simple_SMP_Yield(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 992668403d..b12dd5f0d4 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -313,13 +313,7 @@ typedef void ( *Scheduler_SMP_Update )(
Priority_Control new_priority
);
-typedef Thread_Control *( *Scheduler_SMP_Enqueue )(
- Scheduler_Context *context,
- Scheduler_Node *node_to_enqueue,
- Thread_Control *needs_help
-);
-
-typedef Thread_Control *( *Scheduler_SMP_Enqueue_scheduled )(
+typedef bool ( *Scheduler_SMP_Enqueue )(
Scheduler_Context *context,
Scheduler_Node *node_to_enqueue
);
@@ -617,7 +611,7 @@ static inline Scheduler_Node *_Scheduler_SMP_Get_lowest_scheduled(
return lowest_scheduled;
}
-static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
+static inline void _Scheduler_SMP_Enqueue_to_scheduled(
Scheduler_Context *context,
Scheduler_Node *node,
Scheduler_Node *lowest_scheduled,
@@ -626,7 +620,6 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
Scheduler_SMP_Allocate_processor allocate_processor
)
{
- Thread_Control *needs_help;
Scheduler_Try_to_schedule_action action;
action = _Scheduler_Try_to_schedule_node(
@@ -637,10 +630,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
);
if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
- Thread_Control *lowest_scheduled_user;
- Thread_Control *idle;
-
- lowest_scheduled_user = _Scheduler_SMP_Preempt(
+ _Scheduler_SMP_Preempt(
context,
node,
lowest_scheduled,
@@ -650,16 +640,11 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
( *insert_scheduled )( context, node );
( *move_from_scheduled_to_ready )( context, lowest_scheduled );
- idle = _Scheduler_Release_idle_thread(
+ _Scheduler_Release_idle_thread(
context,
lowest_scheduled,
_Scheduler_SMP_Release_idle_thread
);
- if ( idle == NULL ) {
- needs_help = lowest_scheduled_user;
- } else {
- needs_help = NULL;
- }
} else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
_Scheduler_SMP_Node_change_state(
lowest_scheduled,
@@ -675,15 +660,10 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
lowest_scheduled,
_Scheduler_Node_get_idle( lowest_scheduled )
);
-
- needs_help = NULL;
} else {
_Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
- needs_help = NULL;
}
-
- return needs_help;
}
/**
@@ -693,8 +673,6 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
*
* @param[in] context The scheduler instance context.
* @param[in] node The node to enqueue.
- * @param[in] needs_help The thread needing help in case the node cannot be
- * scheduled.
* @param[in] order The order function.
* @param[in] insert_ready Function to insert a node into the set of ready
* nodes.
@@ -709,10 +687,9 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
* @param[in] allocate_processor Function to allocate a processor to a node
* based on the rules of the scheduler.
*/
-static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered(
+static inline bool _Scheduler_SMP_Enqueue_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
- Thread_Control *needs_help,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled,
@@ -721,11 +698,13 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered(
Scheduler_SMP_Allocate_processor allocate_processor
)
{
- Scheduler_Node *lowest_scheduled =
- ( *get_lowest_scheduled )( context, node, order );
+ bool needs_help;
+ Scheduler_Node *lowest_scheduled;
+
+ lowest_scheduled = ( *get_lowest_scheduled )( context, node, order );
if ( ( *order )( &node->Node, &lowest_scheduled->Node ) ) {
- needs_help = _Scheduler_SMP_Enqueue_to_scheduled(
+ _Scheduler_SMP_Enqueue_to_scheduled(
context,
node,
lowest_scheduled,
@@ -733,8 +712,10 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered(
move_from_scheduled_to_ready,
allocate_processor
);
+ needs_help = false;
} else {
( *insert_ready )( context, node );
+ needs_help = true;
}
return needs_help;
@@ -759,7 +740,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered(
* @param[in] allocate_processor Function to allocate a processor to a node
* based on the rules of the scheduler.
*/
-static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
+static inline bool _Scheduler_SMP_Enqueue_scheduled_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
Chain_Node_order order,
@@ -811,7 +792,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
_Thread_Scheduler_release_critical( owner, &lock_context );
}
- return NULL;
+ return false;
}
action = _Scheduler_Try_to_schedule_node(
@@ -822,10 +803,9 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
);
if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
- Thread_Control *user;
Thread_Control *idle;
- user = _Scheduler_SMP_Preempt(
+ _Scheduler_SMP_Preempt(
context,
highest_ready,
node,
@@ -840,12 +820,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
node,
_Scheduler_SMP_Release_idle_thread
);
-
- if ( idle == NULL ) {
- return user;
- } else {
- return NULL;
- }
+ return ( idle == NULL );
} else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
_Scheduler_SMP_Node_change_state(
@@ -861,7 +836,7 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
node,
_Scheduler_Node_get_idle( node )
);
- return NULL;
+ return false;
} else {
_Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
@@ -982,7 +957,7 @@ static inline void _Scheduler_SMP_Block(
}
}
-static inline Thread_Control *_Scheduler_SMP_Unblock(
+static inline bool _Scheduler_SMP_Unblock(
Scheduler_Context *context,
Thread_Control *thread,
Scheduler_Node *node,
@@ -992,7 +967,7 @@ static inline Thread_Control *_Scheduler_SMP_Unblock(
{
Scheduler_SMP_Node_state node_state;
bool unblock;
- Thread_Control *needs_help;
+ bool needs_help;
node_state = _Scheduler_SMP_Node_state( node );
unblock = _Scheduler_Unblock_node(
@@ -1017,31 +992,31 @@ static inline Thread_Control *_Scheduler_SMP_Unblock(
if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
- needs_help = ( *enqueue_fifo )( context, node, thread );
+ needs_help = ( *enqueue_fifo )( context, node );
} else {
_Assert( node_state == SCHEDULER_SMP_NODE_READY );
_Assert( node->sticky_level > 0 );
_Assert( node->idle == NULL );
- needs_help = thread;
+ needs_help = true;
}
} else {
- needs_help = NULL;
+ needs_help = false;
}
return needs_help;
}
static inline void _Scheduler_SMP_Update_priority(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- Scheduler_SMP_Extract extract_from_ready,
- Scheduler_SMP_Update update,
- Scheduler_SMP_Enqueue enqueue_fifo,
- Scheduler_SMP_Enqueue enqueue_lifo,
- Scheduler_SMP_Enqueue_scheduled enqueue_scheduled_fifo,
- Scheduler_SMP_Enqueue_scheduled enqueue_scheduled_lifo,
- Scheduler_SMP_Ask_for_help ask_for_help
+ Scheduler_Context *context,
+ Thread_Control *thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Update update,
+ Scheduler_SMP_Enqueue enqueue_fifo,
+ Scheduler_SMP_Enqueue enqueue_lifo,
+ Scheduler_SMP_Enqueue enqueue_scheduled_fifo,
+ Scheduler_SMP_Enqueue enqueue_scheduled_lifo,
+ Scheduler_SMP_Ask_for_help ask_for_help
)
{
Priority_Control new_priority;
@@ -1076,9 +1051,9 @@ static inline void _Scheduler_SMP_Update_priority(
( *update )( context, node, new_priority );
if ( prepend_it ) {
- ( *enqueue_lifo )( context, node, NULL );
+ ( *enqueue_lifo )( context, node );
} else {
- ( *enqueue_fifo )( context, node, NULL );
+ ( *enqueue_fifo )( context, node );
}
} else {
( *update )( context, node, new_priority );
@@ -1089,17 +1064,17 @@ static inline void _Scheduler_SMP_Update_priority(
}
}
-static inline Thread_Control *_Scheduler_SMP_Yield(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- Scheduler_SMP_Extract extract_from_ready,
- Scheduler_SMP_Enqueue enqueue_fifo,
- Scheduler_SMP_Enqueue_scheduled enqueue_scheduled_fifo
+static inline bool _Scheduler_SMP_Yield(
+ Scheduler_Context *context,
+ Thread_Control *thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Enqueue enqueue_fifo,
+ Scheduler_SMP_Enqueue enqueue_scheduled_fifo
)
{
- Thread_Control *needs_help;
- Scheduler_SMP_Node_state node_state;
+ bool needs_help;
+ Scheduler_SMP_Node_state node_state;
node_state = _Scheduler_SMP_Node_state( node );
@@ -1110,9 +1085,9 @@ static inline Thread_Control *_Scheduler_SMP_Yield(
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
( *extract_from_ready )( context, node );
- needs_help = ( *enqueue_fifo )( context, node, NULL );
+ needs_help = ( *enqueue_fifo )( context, node );
} else {
- needs_help = thread;
+ needs_help = true;
}
return needs_help;
diff --git a/cpukit/score/include/rtems/score/schedulerstrongapa.h b/cpukit/score/include/rtems/score/schedulerstrongapa.h
index 40a6675573..99013f2ef9 100644
--- a/cpukit/score/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/score/include/rtems/score/schedulerstrongapa.h
@@ -113,7 +113,7 @@ void _Scheduler_strong_APA_Block(
Scheduler_Node *node
);
-Thread_Control *_Scheduler_strong_APA_Unblock(
+bool _Scheduler_strong_APA_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -144,7 +144,7 @@ void _Scheduler_strong_APA_Withdraw_node(
Thread_Scheduler_state next_state
);
-Thread_Control *_Scheduler_strong_APA_Yield(
+bool _Scheduler_strong_APA_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/src/schedulercbsunblock.c b/cpukit/score/src/schedulercbsunblock.c
index 63abc12c70..be9696eed8 100644
--- a/cpukit/score/src/schedulercbsunblock.c
+++ b/cpukit/score/src/schedulercbsunblock.c
@@ -25,7 +25,7 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/watchdogimpl.h>
-Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
+Scheduler_Void_or_bool _Scheduler_CBS_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -68,5 +68,5 @@ Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
}
_Scheduler_EDF_Unblock( scheduler, the_thread, &the_node->Base.Base );
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/scheduleredfunblock.c b/cpukit/score/src/scheduleredfunblock.c
index 5b3fbb3943..45653396af 100644
--- a/cpukit/score/src/scheduleredfunblock.c
+++ b/cpukit/score/src/scheduleredfunblock.c
@@ -22,7 +22,7 @@
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/thread.h>
-Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
+Scheduler_Void_or_bool _Scheduler_EDF_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -60,5 +60,5 @@ Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
);
}
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/scheduleredfyield.c b/cpukit/score/src/scheduleredfyield.c
index a54b1f5c72..dfcb4d3569 100644
--- a/cpukit/score/src/scheduleredfyield.c
+++ b/cpukit/score/src/scheduleredfyield.c
@@ -21,7 +21,7 @@
#include <rtems/score/scheduleredfimpl.h>
-Scheduler_Void_or_thread _Scheduler_EDF_Yield(
+Scheduler_Void_or_bool _Scheduler_EDF_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -37,5 +37,5 @@ Scheduler_Void_or_thread _Scheduler_EDF_Yield(
_Scheduler_EDF_Enqueue( context, the_node, the_node->priority );
_Scheduler_EDF_Schedule_body( scheduler, the_thread, true );
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 9c8fd3cd51..3ca3b73f10 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -270,16 +270,14 @@ static Scheduler_Node * _Scheduler_priority_affinity_SMP_Get_lowest_scheduled(
* _Scheduler_priority_affinity_SMP_Get_lowest_scheduled into
* _Scheduler_SMP_Enqueue_ordered.
*/
-static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_fifo(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_fifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_priority_affinity_SMP_Insert_priority_fifo_order,
_Scheduler_priority_SMP_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo,
@@ -354,14 +352,14 @@ static void _Scheduler_priority_affinity_SMP_Check_for_migrations(
/*
* This is the public scheduler specific Unblock operation.
*/
-Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
+bool _Scheduler_priority_affinity_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
- Thread_Control *needs_help;
+ bool needs_help;
needs_help = _Scheduler_SMP_Unblock(
context,
@@ -383,10 +381,9 @@ Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
* This is unique to this scheduler because it passes scheduler specific
* get_lowest_scheduled helper to _Scheduler_SMP_Enqueue_ordered.
*/
-static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_ordered(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
- Thread_Control *needs_help,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -395,7 +392,6 @@ static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_ordered(
return _Scheduler_SMP_Enqueue_ordered(
context,
node,
- needs_help,
order,
insert_ready,
insert_scheduled,
@@ -410,16 +406,14 @@ static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_ordered(
* to _Scheduler_priority_affinity_SMP_Enqueue_ordered() which
* invokes a scheduler unique get_lowest_scheduled helper.
*/
-static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_lifo(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_lifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_priority_affinity_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_priority_affinity_SMP_Insert_priority_lifo_order,
_Scheduler_priority_SMP_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
@@ -431,8 +425,7 @@ static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_lifo(
* invoke _Scheduler_SMP_Enqueue_scheduled_ordered() with
* this scheduler's get_highest_ready() helper.
*/
-static Thread_Control *
-_Scheduler_priority_affinity_SMP_Enqueue_scheduled_ordered(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
Chain_Node_order order,
@@ -458,7 +451,7 @@ _Scheduler_priority_affinity_SMP_Enqueue_scheduled_ordered(
* to _Scheduler_priority_affinity_SMP_Enqueue_scheduled__ordered() which
* invokes a scheduler unique get_lowest_scheduled helper.
*/
-static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_lifo(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_lifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -477,7 +470,7 @@ static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_lifo(
* to _Scheduler_priority_affinity_SMP_Enqueue_scheduled__ordered() which
* invokes a scheduler unique get_lowest_scheduled helper.
*/
-static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_fifo(
+static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_fifo(
Scheduler_Context *context,
Scheduler_Node *node
)
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index fac2b6da7e..79b3d597a8 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -109,10 +109,9 @@ void _Scheduler_priority_SMP_Block(
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_ordered(
+static bool _Scheduler_priority_SMP_Enqueue_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
- Thread_Control *needs_help,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -121,7 +120,6 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_ordered(
return _Scheduler_SMP_Enqueue_ordered(
context,
node,
- needs_help,
order,
insert_ready,
insert_scheduled,
@@ -131,39 +129,35 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_ordered(
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_lifo(
+static bool _Scheduler_priority_SMP_Enqueue_lifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_priority_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_lifo_order,
_Scheduler_priority_SMP_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_fifo(
+static bool _Scheduler_priority_SMP_Enqueue_fifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_priority_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_fifo_order,
_Scheduler_priority_SMP_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_ordered(
+static bool _Scheduler_priority_SMP_Enqueue_scheduled_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
Chain_Node_order order,
@@ -184,7 +178,7 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_ordered(
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_lifo(
+static bool _Scheduler_priority_SMP_Enqueue_scheduled_lifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -198,7 +192,7 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_lifo(
);
}
-static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_fifo(
+static bool _Scheduler_priority_SMP_Enqueue_scheduled_fifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -212,7 +206,7 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_fifo(
);
}
-Thread_Control *_Scheduler_priority_SMP_Unblock(
+bool _Scheduler_priority_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
@@ -318,7 +312,7 @@ void _Scheduler_priority_SMP_Withdraw_node(
);
}
-Thread_Control *_Scheduler_priority_SMP_Yield(
+bool _Scheduler_priority_SMP_Yield(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
diff --git a/cpukit/score/src/schedulerpriorityunblock.c b/cpukit/score/src/schedulerpriorityunblock.c
index 99d4310a4c..405b83f350 100644
--- a/cpukit/score/src/schedulerpriorityunblock.c
+++ b/cpukit/score/src/schedulerpriorityunblock.c
@@ -22,7 +22,7 @@
#include <rtems/score/schedulerpriorityimpl.h>
-Scheduler_Void_or_thread _Scheduler_priority_Unblock (
+Scheduler_Void_or_bool _Scheduler_priority_Unblock (
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -72,5 +72,5 @@ Scheduler_Void_or_thread _Scheduler_priority_Unblock (
_Scheduler_Update_heir( the_thread, priority == PRIORITY_PSEUDO_ISR );
}
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/schedulerpriorityyield.c b/cpukit/score/src/schedulerpriorityyield.c
index 4d22dc9b4d..439877d0ce 100644
--- a/cpukit/score/src/schedulerpriorityyield.c
+++ b/cpukit/score/src/schedulerpriorityyield.c
@@ -21,7 +21,7 @@
#include <rtems/score/schedulerpriorityimpl.h>
#include <rtems/score/threadimpl.h>
-Scheduler_Void_or_thread _Scheduler_priority_Yield(
+Scheduler_Void_or_bool _Scheduler_priority_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -40,5 +40,5 @@ Scheduler_Void_or_thread _Scheduler_priority_Yield(
_Scheduler_priority_Schedule_body( scheduler, the_thread, true );
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index ed2d5d1b73..392d4ff78a 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -176,10 +176,9 @@ void _Scheduler_simple_SMP_Block(
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_ordered(
+static bool _Scheduler_simple_SMP_Enqueue_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
- Thread_Control *needs_help,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -188,7 +187,6 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_ordered(
return _Scheduler_SMP_Enqueue_ordered(
context,
node,
- needs_help,
order,
insert_ready,
insert_scheduled,
@@ -198,39 +196,35 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_ordered(
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_lifo(
+static bool _Scheduler_simple_SMP_Enqueue_lifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_simple_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_lifo_order,
_Scheduler_simple_SMP_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_fifo(
+static bool _Scheduler_simple_SMP_Enqueue_fifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_simple_SMP_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_fifo_order,
_Scheduler_simple_SMP_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_ordered(
+static bool _Scheduler_simple_SMP_Enqueue_scheduled_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
Chain_Node_order order,
@@ -251,7 +245,7 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_ordered(
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_lifo(
+static bool _Scheduler_simple_SMP_Enqueue_scheduled_lifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -265,7 +259,7 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_lifo(
);
}
-static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_fifo(
+static bool _Scheduler_simple_SMP_Enqueue_scheduled_fifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -279,7 +273,7 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_fifo(
);
}
-Thread_Control *_Scheduler_simple_SMP_Unblock(
+bool _Scheduler_simple_SMP_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
@@ -385,7 +379,7 @@ void _Scheduler_simple_SMP_Withdraw_node(
);
}
-Thread_Control *_Scheduler_simple_SMP_Yield(
+bool _Scheduler_simple_SMP_Yield(
const Scheduler_Control *scheduler,
Thread_Control *thread,
Scheduler_Node *node
diff --git a/cpukit/score/src/schedulersimpleunblock.c b/cpukit/score/src/schedulersimpleunblock.c
index 5eeaf6cc35..fe02ece5b2 100644
--- a/cpukit/score/src/schedulersimpleunblock.c
+++ b/cpukit/score/src/schedulersimpleunblock.c
@@ -21,7 +21,7 @@
#include <rtems/score/schedulersimpleimpl.h>
#include <rtems/score/thread.h>
-Scheduler_Void_or_thread _Scheduler_simple_Unblock(
+Scheduler_Void_or_bool _Scheduler_simple_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -55,5 +55,5 @@ Scheduler_Void_or_thread _Scheduler_simple_Unblock(
);
}
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/schedulersimpleyield.c b/cpukit/score/src/schedulersimpleyield.c
index cfd123fb8c..c84f571933 100644
--- a/cpukit/score/src/schedulersimpleyield.c
+++ b/cpukit/score/src/schedulersimpleyield.c
@@ -20,7 +20,7 @@
#include <rtems/score/schedulersimpleimpl.h>
-Scheduler_Void_or_thread _Scheduler_simple_Yield(
+Scheduler_Void_or_bool _Scheduler_simple_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -35,5 +35,5 @@ Scheduler_Void_or_thread _Scheduler_simple_Yield(
_Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread );
_Scheduler_simple_Schedule_body( scheduler, the_thread, false );
- SCHEDULER_RETURN_VOID_OR_NULL;
+ SCHEDULER_RETURN_VOID_OR_BOOL;
}
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index fce4541aa4..eaa352e793 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -235,10 +235,9 @@ void _Scheduler_strong_APA_Block(
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_ordered(
+static bool _Scheduler_strong_APA_Enqueue_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
- Thread_Control *needs_help,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -247,7 +246,6 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_ordered(
return _Scheduler_SMP_Enqueue_ordered(
context,
node,
- needs_help,
order,
insert_ready,
insert_scheduled,
@@ -257,39 +255,35 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_ordered(
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_lifo(
+static bool _Scheduler_strong_APA_Enqueue_lifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_strong_APA_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_lifo_order,
_Scheduler_strong_APA_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_fifo(
+static bool _Scheduler_strong_APA_Enqueue_fifo(
Scheduler_Context *context,
- Scheduler_Node *node,
- Thread_Control *needs_help
+ Scheduler_Node *node
)
{
return _Scheduler_strong_APA_Enqueue_ordered(
context,
node,
- needs_help,
_Scheduler_SMP_Insert_priority_fifo_order,
_Scheduler_strong_APA_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_ordered(
+static bool _Scheduler_strong_APA_Enqueue_scheduled_ordered(
Scheduler_Context *context,
Scheduler_Node *node,
Chain_Node_order order,
@@ -310,7 +304,7 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_ordered(
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_lifo(
+static bool _Scheduler_strong_APA_Enqueue_scheduled_lifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -324,7 +318,7 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_lifo(
);
}
-static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_fifo(
+static bool _Scheduler_strong_APA_Enqueue_scheduled_fifo(
Scheduler_Context *context,
Scheduler_Node *node
)
@@ -338,7 +332,7 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_fifo(
);
}
-Thread_Control *_Scheduler_strong_APA_Unblock(
+bool _Scheduler_strong_APA_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -444,7 +438,7 @@ void _Scheduler_strong_APA_Withdraw_node(
);
}
-Thread_Control *_Scheduler_strong_APA_Yield(
+bool _Scheduler_strong_APA_Yield(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c
index 55c79424f7..16e00c63b5 100644
--- a/testsuites/smptests/smpscheduler03/init.c
+++ b/testsuites/smptests/smpscheduler03/init.c
@@ -314,7 +314,7 @@ static void test_update_priority_op(void)
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
}
-static Thread_Control *yield_op(
+static bool yield_op(
Thread_Control *thread,
Scheduler_SMP_Node *scheduler_node
)
@@ -322,7 +322,7 @@ static Thread_Control *yield_op(
const Scheduler_Control *scheduler;
ISR_lock_Context state_lock_context;
ISR_lock_Context scheduler_lock_context;
- Thread_Control *needs_help;
+ bool needs_help;
_Thread_State_acquire( thread, &state_lock_context );
scheduler = _Thread_Scheduler_get_home( thread );
@@ -348,7 +348,7 @@ static void test_case_yield_op(
Scheduler_SMP_Node_state new_state
)
{
- Thread_Control *needs_help;
+ bool needs_help;
Per_CPU_Control *cpu_self;
cpu_self = _Thread_Dispatch_disable();
@@ -395,20 +395,16 @@ static void test_case_yield_op(
needs_help = yield_op(executing, executing_node);
rtems_test_assert(executing_node->state == new_state);
- if (start_state != new_state) {
- switch (start_state) {
- case SCHEDULER_SMP_NODE_SCHEDULED:
- rtems_test_assert(needs_help == executing);
- break;
- case SCHEDULER_SMP_NODE_READY:
- rtems_test_assert(needs_help == other);
- break;
- default:
- rtems_test_assert(0);
- break;
- }
- } else {
- rtems_test_assert(needs_help == NULL);
+ switch (new_state) {
+ case SCHEDULER_SMP_NODE_SCHEDULED:
+ rtems_test_assert(!needs_help);
+ break;
+ case SCHEDULER_SMP_NODE_READY:
+ rtems_test_assert(needs_help);
+ break;
+ default:
+ rtems_test_assert(0);
+ break;
}
change_priority(executing, 1, true);
@@ -473,7 +469,7 @@ static void block_op(
_Thread_State_release( thread, &state_lock_context );
}
-static Thread_Control *unblock_op(
+static bool unblock_op(
Thread_Control *thread,
Scheduler_SMP_Node *scheduler_node
)
@@ -481,7 +477,7 @@ static Thread_Control *unblock_op(
const Scheduler_Control *scheduler;
ISR_lock_Context state_lock_context;
ISR_lock_Context scheduler_lock_context;
- Thread_Control *needs_help;
+ bool needs_help;
_Thread_State_acquire( thread, &state_lock_context );
scheduler = _Thread_Scheduler_get_home( thread );
@@ -506,7 +502,7 @@ static void test_case_unblock_op(
Scheduler_SMP_Node_state new_state
)
{
- Thread_Control *needs_help;
+ bool needs_help;
Per_CPU_Control *cpu_self;
cpu_self = _Thread_Dispatch_disable();
@@ -533,10 +529,10 @@ static void test_case_unblock_op(
switch (new_state) {
case SCHEDULER_SMP_NODE_SCHEDULED:
- rtems_test_assert(needs_help == other);
+ rtems_test_assert(!needs_help);
break;
case SCHEDULER_SMP_NODE_READY:
- rtems_test_assert(needs_help == executing);
+ rtems_test_assert(needs_help);
break;
default:
rtems_test_assert(0);