forked from Imagelibrary/rtems
score: Pass scheduler node to block operation
Changed for consistency with other scheduler operations. Update #2556.
This commit is contained in:
@@ -72,7 +72,8 @@ typedef struct {
|
|||||||
/** @see _Scheduler_Block() */
|
/** @see _Scheduler_Block() */
|
||||||
void ( *block )(
|
void ( *block )(
|
||||||
const Scheduler_Control *,
|
const Scheduler_Control *,
|
||||||
Thread_Control *
|
Thread_Control *,
|
||||||
|
Scheduler_Node *
|
||||||
);
|
);
|
||||||
|
|
||||||
/** @see _Scheduler_Unblock() */
|
/** @see _Scheduler_Unblock() */
|
||||||
|
|||||||
@@ -108,20 +108,10 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler );
|
void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler );
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Removes thread from ready queue.
|
|
||||||
*
|
|
||||||
* This routine removes @a the_thread from the scheduling decision,
|
|
||||||
* that is, removes it from the ready queue. It performs
|
|
||||||
* any necessary scheduling operations including the selection of
|
|
||||||
* a new heir thread.
|
|
||||||
*
|
|
||||||
* @param[in] scheduler The scheduler instance.
|
|
||||||
* @param[in] the_thread is the thread to be blocked.
|
|
||||||
*/
|
|
||||||
void _Scheduler_EDF_Block(
|
void _Scheduler_EDF_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -136,16 +136,17 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract(
|
|||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
|
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_EDF_Context *context;
|
Scheduler_EDF_Context *context;
|
||||||
Scheduler_EDF_Node *node;
|
Scheduler_EDF_Node *the_node;
|
||||||
|
|
||||||
context = _Scheduler_EDF_Get_context( scheduler );
|
context = _Scheduler_EDF_Get_context( scheduler );
|
||||||
node = _Scheduler_EDF_Thread_get_node( the_thread );
|
the_node = _Scheduler_EDF_Node_downcast( node );
|
||||||
|
|
||||||
_Scheduler_EDF_Extract( context, node );
|
_Scheduler_EDF_Extract( context, the_node );
|
||||||
}
|
}
|
||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body(
|
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body(
|
||||||
|
|||||||
@@ -330,7 +330,11 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
|
|||||||
scheduler = _Scheduler_Get( the_thread );
|
scheduler = _Scheduler_Get( the_thread );
|
||||||
_Scheduler_Acquire_critical( scheduler, &lock_context );
|
_Scheduler_Acquire_critical( scheduler, &lock_context );
|
||||||
|
|
||||||
( *scheduler->Operations.block )( scheduler, the_thread );
|
( *scheduler->Operations.block )(
|
||||||
|
scheduler,
|
||||||
|
the_thread,
|
||||||
|
_Thread_Scheduler_get_home_node( the_thread )
|
||||||
|
);
|
||||||
|
|
||||||
_Scheduler_Release_critical( scheduler, &lock_context );
|
_Scheduler_Release_critical( scheduler, &lock_context );
|
||||||
}
|
}
|
||||||
@@ -708,16 +712,20 @@ bool _Scheduler_Set_affinity(
|
|||||||
RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
|
RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node,
|
||||||
void ( *extract )(
|
void ( *extract )(
|
||||||
const Scheduler_Control *,
|
const Scheduler_Control *,
|
||||||
Thread_Control * ),
|
Thread_Control *,
|
||||||
|
Scheduler_Node *
|
||||||
|
),
|
||||||
void ( *schedule )(
|
void ( *schedule )(
|
||||||
const Scheduler_Control *,
|
const Scheduler_Control *,
|
||||||
Thread_Control *,
|
Thread_Control *,
|
||||||
bool )
|
bool
|
||||||
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
( *extract )( scheduler, the_thread );
|
( *extract )( scheduler, the_thread, node );
|
||||||
|
|
||||||
/* TODO: flash critical section? */
|
/* TODO: flash critical section? */
|
||||||
|
|
||||||
|
|||||||
@@ -111,20 +111,10 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
void _Scheduler_priority_Initialize( const Scheduler_Control *scheduler );
|
void _Scheduler_priority_Initialize( const Scheduler_Control *scheduler );
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Removes @a the_thread from the scheduling decision.
|
|
||||||
*
|
|
||||||
* This routine removes @a the_thread from the scheduling decision,
|
|
||||||
* that is, removes it from the ready queue. It performs
|
|
||||||
* any necessary scheduling operations including the selection of
|
|
||||||
* a new heir thread.
|
|
||||||
*
|
|
||||||
* @param[in] scheduler The scheduler instance.
|
|
||||||
* @param[in] the_thread is the thread to be blocked
|
|
||||||
*/
|
|
||||||
void _Scheduler_priority_Block(
|
void _Scheduler_priority_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,17 +86,10 @@ void _Scheduler_priority_affinity_SMP_Node_initialize(
|
|||||||
Priority_Control priority
|
Priority_Control priority
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief SMP Priority Affinity Scheduler Block Operation
|
|
||||||
*
|
|
||||||
* This method is the block operation for this scheduler.
|
|
||||||
*
|
|
||||||
* @param[in] scheduler is the scheduler instance information
|
|
||||||
* @param[in] thread is the thread to block
|
|
||||||
*/
|
|
||||||
void _Scheduler_priority_affinity_SMP_Block(
|
void _Scheduler_priority_affinity_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -140,16 +140,19 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract(
|
|||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body(
|
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_priority_Context *context =
|
Scheduler_priority_Context *context;
|
||||||
_Scheduler_priority_Get_context( scheduler );
|
Scheduler_priority_Node *the_node;
|
||||||
Scheduler_priority_Node *node = _Scheduler_priority_Thread_get_node( the_thread );
|
|
||||||
|
context = _Scheduler_priority_Get_context( scheduler );
|
||||||
|
the_node = _Scheduler_priority_Node_downcast( node );
|
||||||
|
|
||||||
_Scheduler_priority_Ready_queue_extract(
|
_Scheduler_priority_Ready_queue_extract(
|
||||||
&the_thread->Object.Node,
|
&the_thread->Object.Node,
|
||||||
&node->Ready_queue,
|
&the_node->Ready_queue,
|
||||||
&context->Bit_map
|
&context->Bit_map
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ void _Scheduler_priority_SMP_Node_initialize(
|
|||||||
|
|
||||||
void _Scheduler_priority_SMP_Block(
|
void _Scheduler_priority_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
Thread_Control *_Scheduler_priority_SMP_Unblock(
|
Thread_Control *_Scheduler_priority_SMP_Unblock(
|
||||||
|
|||||||
@@ -98,20 +98,10 @@ Scheduler_Void_or_thread _Scheduler_simple_Yield(
|
|||||||
Scheduler_Node *node
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Remove a simple-priority-based thread from the queue.
|
|
||||||
*
|
|
||||||
* This routine removes @a the_thread from the scheduling decision,
|
|
||||||
* that is, removes it from the ready queue. It performs
|
|
||||||
* any necessary scheduling operations including the selection of
|
|
||||||
* a new heir thread.
|
|
||||||
*
|
|
||||||
* @param[in] scheduler The scheduler instance.
|
|
||||||
* @param[in] the_thread is the thread that is to be blocked
|
|
||||||
*/
|
|
||||||
void _Scheduler_simple_Block(
|
void _Scheduler_simple_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -88,10 +88,12 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_priority_fifo(
|
|||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(
|
RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
(void) scheduler;
|
(void) scheduler;
|
||||||
|
(void) node;
|
||||||
|
|
||||||
_Chain_Extract_unprotected( &the_thread->Object.Node );
|
_Chain_Extract_unprotected( &the_thread->Object.Node );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ void _Scheduler_simple_SMP_Node_initialize(
|
|||||||
|
|
||||||
void _Scheduler_simple_SMP_Block(
|
void _Scheduler_simple_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
Thread_Control *_Scheduler_simple_SMP_Unblock(
|
Thread_Control *_Scheduler_simple_SMP_Unblock(
|
||||||
|
|||||||
@@ -868,6 +868,7 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
|
|||||||
*
|
*
|
||||||
* @param[in] context The scheduler instance context.
|
* @param[in] context The scheduler instance context.
|
||||||
* @param[in] thread The thread of the scheduling operation.
|
* @param[in] thread The thread of the scheduling operation.
|
||||||
|
* @param[in] node The scheduler node of the thread to block.
|
||||||
* @param[in] extract_from_ready Function to extract a node from the set of
|
* @param[in] extract_from_ready Function to extract a node from the set of
|
||||||
* ready nodes.
|
* ready nodes.
|
||||||
* @param[in] get_highest_ready Function to get the highest ready node.
|
* @param[in] get_highest_ready Function to get the highest ready node.
|
||||||
@@ -877,41 +878,45 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
|
|||||||
static inline void _Scheduler_SMP_Block(
|
static inline void _Scheduler_SMP_Block(
|
||||||
Scheduler_Context *context,
|
Scheduler_Context *context,
|
||||||
Thread_Control *thread,
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node,
|
||||||
Scheduler_SMP_Extract extract_from_ready,
|
Scheduler_SMP_Extract extract_from_ready,
|
||||||
Scheduler_SMP_Get_highest_ready get_highest_ready,
|
Scheduler_SMP_Get_highest_ready get_highest_ready,
|
||||||
Scheduler_SMP_Move move_from_ready_to_scheduled,
|
Scheduler_SMP_Move move_from_ready_to_scheduled,
|
||||||
Scheduler_SMP_Allocate_processor allocate_processor
|
Scheduler_SMP_Allocate_processor allocate_processor
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node( thread );
|
Scheduler_SMP_Node_state node_state;
|
||||||
bool is_scheduled = node->state == SCHEDULER_SMP_NODE_SCHEDULED;
|
bool block;
|
||||||
bool block;
|
|
||||||
|
|
||||||
_Assert( is_scheduled || node->state == SCHEDULER_SMP_NODE_READY );
|
node_state = _Scheduler_SMP_Node_state( node );
|
||||||
|
_Assert( node_state != SCHEDULER_SMP_NODE_BLOCKED );
|
||||||
|
|
||||||
block = _Scheduler_Block_node(
|
block = _Scheduler_Block_node(
|
||||||
context,
|
context,
|
||||||
thread,
|
thread,
|
||||||
&node->Base,
|
node,
|
||||||
is_scheduled,
|
node_state == SCHEDULER_SMP_NODE_SCHEDULED,
|
||||||
_Scheduler_SMP_Get_idle_thread
|
_Scheduler_SMP_Get_idle_thread
|
||||||
);
|
);
|
||||||
if ( block ) {
|
if ( block ) {
|
||||||
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
|
_Scheduler_SMP_Node_change_state(
|
||||||
|
_Scheduler_SMP_Node_downcast( node ),
|
||||||
|
SCHEDULER_SMP_NODE_BLOCKED
|
||||||
|
);
|
||||||
|
|
||||||
if ( is_scheduled ) {
|
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
|
||||||
_Scheduler_SMP_Extract_from_scheduled( &node->Base );
|
_Scheduler_SMP_Extract_from_scheduled( node );
|
||||||
|
|
||||||
_Scheduler_SMP_Schedule_highest_ready(
|
_Scheduler_SMP_Schedule_highest_ready(
|
||||||
context,
|
context,
|
||||||
&node->Base,
|
node,
|
||||||
extract_from_ready,
|
extract_from_ready,
|
||||||
get_highest_ready,
|
get_highest_ready,
|
||||||
move_from_ready_to_scheduled,
|
move_from_ready_to_scheduled,
|
||||||
allocate_processor
|
allocate_processor
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
( *extract_from_ready )( context, &node->Base );
|
( *extract_from_ready )( context, node );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ void _Scheduler_strong_APA_Node_initialize(
|
|||||||
|
|
||||||
void _Scheduler_strong_APA_Block(
|
void _Scheduler_strong_APA_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
);
|
);
|
||||||
|
|
||||||
Thread_Control *_Scheduler_strong_APA_Unblock(
|
Thread_Control *_Scheduler_strong_APA_Unblock(
|
||||||
|
|||||||
@@ -23,12 +23,14 @@
|
|||||||
|
|
||||||
void _Scheduler_EDF_Block(
|
void _Scheduler_EDF_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Scheduler_Generic_block(
|
_Scheduler_Generic_block(
|
||||||
scheduler,
|
scheduler,
|
||||||
the_thread,
|
the_thread,
|
||||||
|
node,
|
||||||
_Scheduler_EDF_Extract_body,
|
_Scheduler_EDF_Extract_body,
|
||||||
_Scheduler_EDF_Schedule_body
|
_Scheduler_EDF_Schedule_body
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ static Scheduler_Node *_Scheduler_priority_affinity_SMP_Get_highest_ready(
|
|||||||
*/
|
*/
|
||||||
void _Scheduler_priority_affinity_SMP_Block(
|
void _Scheduler_priority_affinity_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
||||||
@@ -198,6 +199,7 @@ void _Scheduler_priority_affinity_SMP_Block(
|
|||||||
_Scheduler_SMP_Block(
|
_Scheduler_SMP_Block(
|
||||||
context,
|
context,
|
||||||
thread,
|
thread,
|
||||||
|
node,
|
||||||
_Scheduler_priority_SMP_Extract_from_ready,
|
_Scheduler_priority_SMP_Extract_from_ready,
|
||||||
_Scheduler_priority_affinity_SMP_Get_highest_ready,
|
_Scheduler_priority_affinity_SMP_Get_highest_ready,
|
||||||
_Scheduler_priority_SMP_Move_from_ready_to_scheduled,
|
_Scheduler_priority_SMP_Move_from_ready_to_scheduled,
|
||||||
@@ -599,7 +601,7 @@ bool _Scheduler_priority_affinity_SMP_Set_affinity(
|
|||||||
current_state = thread->current_state;
|
current_state = thread->current_state;
|
||||||
|
|
||||||
if ( _States_Is_ready( current_state ) ) {
|
if ( _States_Is_ready( current_state ) ) {
|
||||||
_Scheduler_priority_affinity_SMP_Block( scheduler, thread );
|
_Scheduler_priority_affinity_SMP_Block( scheduler, thread, &node->Base.Base.Base );
|
||||||
}
|
}
|
||||||
|
|
||||||
CPU_COPY( node->Affinity.set, cpuset );
|
CPU_COPY( node->Affinity.set, cpuset );
|
||||||
|
|||||||
@@ -24,12 +24,14 @@
|
|||||||
|
|
||||||
void _Scheduler_priority_Block(
|
void _Scheduler_priority_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Scheduler_Generic_block(
|
_Scheduler_Generic_block(
|
||||||
scheduler,
|
scheduler,
|
||||||
the_thread,
|
the_thread,
|
||||||
|
node,
|
||||||
_Scheduler_priority_Extract_body,
|
_Scheduler_priority_Extract_body,
|
||||||
_Scheduler_priority_Schedule_body
|
_Scheduler_priority_Schedule_body
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ static Scheduler_Node *_Scheduler_priority_SMP_Get_highest_ready(
|
|||||||
|
|
||||||
void _Scheduler_priority_SMP_Block(
|
void _Scheduler_priority_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
||||||
@@ -100,6 +101,7 @@ void _Scheduler_priority_SMP_Block(
|
|||||||
_Scheduler_SMP_Block(
|
_Scheduler_SMP_Block(
|
||||||
context,
|
context,
|
||||||
thread,
|
thread,
|
||||||
|
node,
|
||||||
_Scheduler_priority_SMP_Extract_from_ready,
|
_Scheduler_priority_SMP_Extract_from_ready,
|
||||||
_Scheduler_priority_SMP_Get_highest_ready,
|
_Scheduler_priority_SMP_Get_highest_ready,
|
||||||
_Scheduler_priority_SMP_Move_from_ready_to_scheduled,
|
_Scheduler_priority_SMP_Move_from_ready_to_scheduled,
|
||||||
|
|||||||
@@ -23,12 +23,14 @@
|
|||||||
|
|
||||||
void _Scheduler_simple_Block(
|
void _Scheduler_simple_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Scheduler_Generic_block(
|
_Scheduler_Generic_block(
|
||||||
scheduler,
|
scheduler,
|
||||||
the_thread,
|
the_thread,
|
||||||
|
node,
|
||||||
_Scheduler_simple_Extract,
|
_Scheduler_simple_Extract,
|
||||||
_Scheduler_simple_Schedule_body
|
_Scheduler_simple_Schedule_body
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Scheduler_Void_or_thread _Scheduler_simple_Update_priority(
|
|||||||
context = _Scheduler_simple_Get_context( scheduler );
|
context = _Scheduler_simple_Get_context( scheduler );
|
||||||
_Scheduler_Node_get_priority( node, &prepend_it );
|
_Scheduler_Node_get_priority( node, &prepend_it );
|
||||||
|
|
||||||
_Scheduler_simple_Extract( scheduler, the_thread );
|
_Scheduler_simple_Extract( scheduler, the_thread, node );
|
||||||
|
|
||||||
if ( prepend_it ) {
|
if ( prepend_it ) {
|
||||||
_Scheduler_simple_Insert_priority_lifo( &context->Ready, the_thread );
|
_Scheduler_simple_Insert_priority_lifo( &context->Ready, the_thread );
|
||||||
|
|||||||
@@ -159,7 +159,8 @@ static void _Scheduler_simple_SMP_Extract_from_ready(
|
|||||||
|
|
||||||
void _Scheduler_simple_SMP_Block(
|
void _Scheduler_simple_SMP_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *thread
|
Thread_Control *thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
||||||
@@ -167,6 +168,7 @@ void _Scheduler_simple_SMP_Block(
|
|||||||
_Scheduler_SMP_Block(
|
_Scheduler_SMP_Block(
|
||||||
context,
|
context,
|
||||||
thread,
|
thread,
|
||||||
|
node,
|
||||||
_Scheduler_simple_SMP_Extract_from_ready,
|
_Scheduler_simple_SMP_Extract_from_ready,
|
||||||
_Scheduler_simple_SMP_Get_highest_ready,
|
_Scheduler_simple_SMP_Get_highest_ready,
|
||||||
_Scheduler_simple_SMP_Move_from_ready_to_scheduled,
|
_Scheduler_simple_SMP_Move_from_ready_to_scheduled,
|
||||||
|
|||||||
@@ -218,7 +218,8 @@ static Scheduler_Node *_Scheduler_strong_APA_Get_highest_ready(
|
|||||||
|
|
||||||
void _Scheduler_strong_APA_Block(
|
void _Scheduler_strong_APA_Block(
|
||||||
const Scheduler_Control *scheduler,
|
const Scheduler_Control *scheduler,
|
||||||
Thread_Control *the_thread
|
Thread_Control *the_thread,
|
||||||
|
Scheduler_Node *node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
|
||||||
@@ -226,6 +227,7 @@ void _Scheduler_strong_APA_Block(
|
|||||||
_Scheduler_SMP_Block(
|
_Scheduler_SMP_Block(
|
||||||
context,
|
context,
|
||||||
the_thread,
|
the_thread,
|
||||||
|
node,
|
||||||
_Scheduler_strong_APA_Extract_from_ready,
|
_Scheduler_strong_APA_Extract_from_ready,
|
||||||
_Scheduler_strong_APA_Get_highest_ready,
|
_Scheduler_strong_APA_Get_highest_ready,
|
||||||
_Scheduler_strong_APA_Move_from_ready_to_scheduled,
|
_Scheduler_strong_APA_Move_from_ready_to_scheduled,
|
||||||
|
|||||||
@@ -460,7 +460,10 @@ static void test_yield_op(void)
|
|||||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void block_op(Thread_Control *thread)
|
static void block_op(
|
||||||
|
Thread_Control *thread,
|
||||||
|
Scheduler_SMP_Node *scheduler_node
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const Scheduler_Control *scheduler;
|
const Scheduler_Control *scheduler;
|
||||||
ISR_lock_Context state_lock_context;
|
ISR_lock_Context state_lock_context;
|
||||||
@@ -470,7 +473,7 @@ static void block_op(Thread_Control *thread)
|
|||||||
scheduler = _Scheduler_Get( thread );
|
scheduler = _Scheduler_Get( thread );
|
||||||
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
|
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
|
||||||
|
|
||||||
(*scheduler->Operations.block)(scheduler, thread);
|
(*scheduler->Operations.block)(scheduler, thread, &scheduler_node->Base);
|
||||||
|
|
||||||
_Scheduler_Release_critical( scheduler, &scheduler_lock_context );
|
_Scheduler_Release_critical( scheduler, &scheduler_lock_context );
|
||||||
_Thread_State_release( thread, &state_lock_context );
|
_Thread_State_release( thread, &state_lock_context );
|
||||||
@@ -521,7 +524,7 @@ static void test_case_unblock_op(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
block_op(executing);
|
block_op(executing, executing_node);
|
||||||
rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_BLOCKED);
|
rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_BLOCKED);
|
||||||
|
|
||||||
needs_help = unblock_op(executing);
|
needs_help = unblock_op(executing);
|
||||||
|
|||||||
Reference in New Issue
Block a user