summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulerprioritysmp.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-13 16:03:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-14 14:46:19 +0200
commitbeab7329fca655c93743fbb590d00bb4ea5a6d78 (patch)
treefbeb6b27f887b46a41f84acc64aecfce18686540 /cpukit/score/include/rtems/score/schedulerprioritysmp.h
parentscore: Scheduler documentation (diff)
downloadrtems-beab7329fca655c93743fbb590d00bb4ea5a6d78.tar.bz2
score: Introduce scheduler nodes
Rename scheduler per-thread information into scheduler nodes using Scheduler_Node as the base type. Use inheritance for specialized schedulers. Move the scheduler specific states from the thread control block into the scheduler node structure. Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is defined.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerprioritysmp.h')
-rw-r--r--cpukit/score/include/rtems/score/schedulerprioritysmp.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index 66de9645bd..3e7d22f81d 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -47,13 +47,33 @@ extern "C" {
* @{
*/
+/**
+ * @brief Scheduler context specialization for Deterministic Priority SMP
+ * schedulers.
+ */
typedef struct {
Scheduler_SMP_Context Base;
Priority_bit_map_Control Bit_map;
- Chain_Control Ready[ 0 ];
+ Chain_Control Ready[ RTEMS_ZERO_LENGTH_ARRAY ];
} Scheduler_priority_SMP_Context;
/**
+ * @brief Scheduler node specialization for Deterministic Priority SMP
+ * schedulers.
+ */
+typedef struct {
+ /**
+ * @brief SMP scheduler node.
+ */
+ Scheduler_SMP_Node Base;
+
+ /**
+ * @brief The associated ready queue of this node.
+ */
+ Scheduler_priority_Ready_queue Ready_queue;
+} Scheduler_priority_SMP_Node;
+
+/**
* @brief Entry points for the Priority SMP Scheduler.
*/
#define SCHEDULER_PRIORITY_SMP_ENTRY_POINTS \
@@ -63,7 +83,7 @@ typedef struct {
_Scheduler_priority_SMP_Yield, \
_Scheduler_priority_SMP_Block, \
_Scheduler_priority_SMP_Enqueue_fifo, \
- _Scheduler_default_Allocate, \
+ _Scheduler_priority_SMP_Allocate, \
_Scheduler_default_Free, \
_Scheduler_priority_SMP_Update, \
_Scheduler_priority_SMP_Enqueue_fifo, \
@@ -79,6 +99,11 @@ typedef struct {
void _Scheduler_priority_SMP_Initialize( const Scheduler_Control *scheduler );
+bool _Scheduler_priority_SMP_Allocate(
+ const Scheduler_Control *scheduler,
+ Thread_Control *thread
+);
+
void _Scheduler_priority_SMP_Schedule(
const Scheduler_Control *scheduler,
Thread_Control *thread