From 8568341d69d16609a3dcf71716a89839b16ac881 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 11 Jun 2014 14:31:03 +0200 Subject: score: Need for help indicator for scheduler ops Return a thread in need for help for the following scheduler operations - unblock, - change priority, and - yield. A thread in need for help is a thread that encounters a scheduler state change from scheduled to ready or a thread that cannot be scheduled in an unblock operation. Such a thread can ask threads which depend on resources owned by this thread for help. --- cpukit/score/include/rtems/score/scheduler.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'cpukit/score/include/rtems/score/scheduler.h') diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index bb30a8e61e..993ae55b29 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -44,6 +44,16 @@ typedef struct Scheduler_Control Scheduler_Control; typedef struct Scheduler_Node Scheduler_Node; +#if defined(RTEMS_SMP) + typedef Thread_Control * Scheduler_Void_or_thread; + + #define SCHEDULER_RETURN_VOID_OR_NULL return NULL +#else + typedef void Scheduler_Void_or_thread; + + #define SCHEDULER_RETURN_VOID_OR_NULL return +#endif + /** * @brief The scheduler operations. */ @@ -55,16 +65,25 @@ typedef struct { void ( *schedule )( const Scheduler_Control *, Thread_Control *); /** @see _Scheduler_Yield() */ - void ( *yield )( const Scheduler_Control *, Thread_Control *); + Scheduler_Void_or_thread ( *yield )( + const Scheduler_Control *, + Thread_Control * + ); /** @see _Scheduler_Block() */ - void ( *block )( const Scheduler_Control *, Thread_Control * ); + void ( *block )( + const Scheduler_Control *, + Thread_Control * + ); /** @see _Scheduler_Unblock() */ - void ( *unblock )( const Scheduler_Control *, Thread_Control * ); + Scheduler_Void_or_thread ( *unblock )( + const Scheduler_Control *, + Thread_Control * + ); /** @see _Scheduler_Change_priority() */ - void ( *change_priority )( + Scheduler_Void_or_thread ( *change_priority )( const Scheduler_Control *, Thread_Control *, Priority_Control, -- cgit v1.2.3