diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-29 09:43:44 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-10 10:38:45 +0200 |
commit | 709796209c88e6749320b3096df57f369c2d62be (patch) | |
tree | 072e7cd5cef37aad7404a02344724a4348602f35 /cpukit/include/rtems/score/scheduleredfsmp.h | |
parent | score: Modify _Scheduler_Unblock() (diff) | |
download | rtems-709796209c88e6749320b3096df57f369c2d62be.tar.bz2 |
score: Add thread pin/unpin support
Add support to temporarily pin a thread to its current processor. This
may be used to access per-processor data structures in critical sections
with enabled thread dispatching, e.g. a pinned thread is allowed to
block.
Update #3508.
Diffstat (limited to 'cpukit/include/rtems/score/scheduleredfsmp.h')
-rw-r--r-- | cpukit/include/rtems/score/scheduleredfsmp.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/cpukit/include/rtems/score/scheduleredfsmp.h b/cpukit/include/rtems/score/scheduleredfsmp.h index 018568190e..72c906eefe 100644 --- a/cpukit/include/rtems/score/scheduleredfsmp.h +++ b/cpukit/include/rtems/score/scheduleredfsmp.h @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2017 embedded brains GmbH. + * Copyright (c) 2017, 2018 embedded brains GmbH. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -43,13 +43,24 @@ typedef struct { int64_t generation; /** - * @brief The ready queue index depending on the processor affinity of the thread. + * @brief The ready queue index depending on the processor affinity and + * pinning of the thread. * * The ready queue index zero is used for threads with a one-to-all thread * processor affinity. Threads with a one-to-one processor affinity use the * processor index plus one as the ready queue index. */ - uint32_t ready_queue_index; + uint8_t ready_queue_index; + + /** + * @brief Ready queue index according to thread affinity. + */ + uint8_t affinity_ready_queue_index; + + /** + * @brief Ready queue index according to thread pinning. + */ + uint8_t pinning_ready_queue_index; } Scheduler_EDF_SMP_Node; typedef struct { @@ -105,6 +116,8 @@ typedef struct { _Scheduler_EDF_SMP_Ask_for_help, \ _Scheduler_EDF_SMP_Reconsider_help_request, \ _Scheduler_EDF_SMP_Withdraw_node, \ + _Scheduler_EDF_SMP_Pin, \ + _Scheduler_EDF_SMP_Unpin, \ _Scheduler_EDF_SMP_Add_processor, \ _Scheduler_EDF_SMP_Remove_processor, \ _Scheduler_EDF_SMP_Node_initialize, \ @@ -162,6 +175,20 @@ void _Scheduler_EDF_SMP_Withdraw_node( Thread_Scheduler_state next_state ); +void _Scheduler_EDF_SMP_Pin( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node, + struct Per_CPU_Control *cpu +); + +void _Scheduler_EDF_SMP_Unpin( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node, + struct Per_CPU_Control *cpu +); + void _Scheduler_EDF_SMP_Add_processor( const Scheduler_Control *scheduler, Thread_Control *idle |