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/score/src/schedulerdefaultpinunpin.c | |
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/score/src/schedulerdefaultpinunpin.c')
-rw-r--r-- | cpukit/score/src/schedulerdefaultpinunpin.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cpukit/score/src/schedulerdefaultpinunpin.c b/cpukit/score/src/schedulerdefaultpinunpin.c new file mode 100644 index 0000000000..5fc9cca026 --- /dev/null +++ b/cpukit/score/src/schedulerdefaultpinunpin.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018 embedded brains GmbH + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/score/scheduler.h> +#include <rtems/score/interr.h> +#include <rtems/score/smpimpl.h> + +void _Scheduler_default_Pin_or_unpin( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node, + struct Per_CPU_Control *cpu +) +{ + (void) scheduler; + (void) the_thread; + (void) node; + (void) cpu; + + if ( _SMP_Get_processor_count() > 1 ) { + _Terminate( + RTEMS_FATAL_SOURCE_SMP, + SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED + ); + } +} |