summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-02 08:55:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-08 09:55:27 +0200
commit52a661e8f8124b77b29a2ed44c7814fd0a7cf358 (patch)
treef932db45c870ba197e348d92bb767170c30ad576
parent15b5678dcd72a11909a54b63ddc8e57869d63244 (diff)
downloadrtems-52a661e8f8124b77b29a2ed44c7814fd0a7cf358.tar.bz2
score: Add scheduler node implementation header
Update #2556.
-rw-r--r--cpukit/score/Makefile.am1
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h100
-rw-r--r--cpukit/score/include/rtems/score/schedulernode.h6
-rw-r--r--cpukit/score/include/rtems/score/schedulernodeimpl.h134
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h1
-rw-r--r--cpukit/score/preinstall.am4
6 files changed, 140 insertions, 106 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index c12820b964..f18af7d4e6 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -73,6 +73,7 @@ include_rtems_score_HEADERS += include/rtems/score/schedulercbsimpl.h
include_rtems_score_HEADERS += include/rtems/score/scheduleredf.h
include_rtems_score_HEADERS += include/rtems/score/scheduleredfimpl.h
include_rtems_score_HEADERS += include/rtems/score/schedulernode.h
+include_rtems_score_HEADERS += include/rtems/score/schedulernodeimpl.h
include_rtems_score_HEADERS += include/rtems/score/schedulerpriority.h
include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityimpl.h
include_rtems_score_HEADERS += include/rtems/score/schedulerprioritysmp.h
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 0832360c91..bbad6e0a36 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -110,15 +110,6 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Scheduler_Thread_get_own_node(
#endif
}
-#if defined(RTEMS_SMP)
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
- const Scheduler_Node *node
-)
-{
- return node->user;
-}
-#endif
-
ISR_LOCK_DECLARE( extern, _Scheduler_Lock )
/**
@@ -779,82 +770,6 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Scheduler_Thread_get_node(
return the_thread->Scheduler.node;
}
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
- Scheduler_Node *node,
- Thread_Control *the_thread,
- Priority_Control priority
-)
-{
- node->owner = the_thread;
-
- node->Priority.value = priority;
- node->Priority.prepend_it = false;
-
-#if defined(RTEMS_SMP)
- node->user = the_thread;
- node->help_state = SCHEDULER_HELP_YOURSELF;
- node->idle = NULL;
- node->accepts_help = the_thread;
- _SMP_sequence_lock_Initialize( &node->Priority.Lock );
-#else
- (void) the_thread;
-#endif
-}
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
- const Scheduler_Node *node
-)
-{
- return node->owner;
-}
-
-RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
- Scheduler_Node *node,
- bool *prepend_it_p
-)
-{
- Priority_Control priority;
- bool prepend_it;
-
-#if defined(RTEMS_SMP)
- unsigned int seq;
-
- do {
- seq = _SMP_sequence_lock_Read_begin( &node->Priority.Lock );
-#endif
-
- priority = node->Priority.value;
- prepend_it = node->Priority.prepend_it;
-
-#if defined(RTEMS_SMP)
- } while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );
-#endif
-
- *prepend_it_p = prepend_it;
-
- return priority;
-}
-
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
- Scheduler_Node *node,
- Priority_Control new_priority,
- bool prepend_it
-)
-{
-#if defined(RTEMS_SMP)
- unsigned int seq;
-
- seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );
-#endif
-
- node->Priority.value = new_priority;
- node->Priority.prepend_it = prepend_it;
-
-#if defined(RTEMS_SMP)
- _SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );
-#endif
-}
-
RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
@@ -893,21 +808,6 @@ typedef void ( *Scheduler_Release_idle_thread )(
Thread_Control *idle
);
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
- const Scheduler_Node *node
-)
-{
- return node->idle;
-}
-
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
- Scheduler_Node *node,
- Thread_Control *user
-)
-{
- node->user = user;
-}
-
RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_node(
Thread_Control *the_thread,
Scheduler_Node *node
diff --git a/cpukit/score/include/rtems/score/schedulernode.h b/cpukit/score/include/rtems/score/schedulernode.h
index 63d86e64ff..293887c4b7 100644
--- a/cpukit/score/include/rtems/score/schedulernode.h
+++ b/cpukit/score/include/rtems/score/schedulernode.h
@@ -205,12 +205,6 @@ typedef struct {
} Priority;
} Scheduler_Node;
-#define SCHEDULER_NODE_OF_WAIT_CHAIN_NODE( node ) \
- RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.Chain )
-
-#define SCHEDULER_NODE_OF_WAIT_RBTREE_NODE( node ) \
- RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.RBTree )
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/cpukit/score/include/rtems/score/schedulernodeimpl.h b/cpukit/score/include/rtems/score/schedulernodeimpl.h
new file mode 100644
index 0000000000..ecb61c239a
--- /dev/null
+++ b/cpukit/score/include/rtems/score/schedulernodeimpl.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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.
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERNODEIMPL_H
+#define _RTEMS_SCORE_SCHEDULERNODEIMPL_H
+
+#include <rtems/score/schedulernode.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define SCHEDULER_NODE_OF_WAIT_CHAIN_NODE( node ) \
+ RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.Chain )
+
+#define SCHEDULER_NODE_OF_WAIT_RBTREE_NODE( node ) \
+ RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.RBTree )
+
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
+ Scheduler_Node *node,
+ Thread_Control *the_thread,
+ Priority_Control priority
+)
+{
+ node->owner = the_thread;
+
+ node->Priority.value = priority;
+ node->Priority.prepend_it = false;
+
+#if defined(RTEMS_SMP)
+ node->user = the_thread;
+ node->help_state = SCHEDULER_HELP_YOURSELF;
+ node->idle = NULL;
+ node->accepts_help = the_thread;
+ _SMP_sequence_lock_Initialize( &node->Priority.Lock );
+#else
+ (void) the_thread;
+#endif
+}
+
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
+ const Scheduler_Node *node
+)
+{
+ return node->owner;
+}
+
+RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
+ Scheduler_Node *node,
+ bool *prepend_it_p
+)
+{
+ Priority_Control priority;
+ bool prepend_it;
+
+#if defined(RTEMS_SMP)
+ unsigned int seq;
+
+ do {
+ seq = _SMP_sequence_lock_Read_begin( &node->Priority.Lock );
+#endif
+
+ priority = node->Priority.value;
+ prepend_it = node->Priority.prepend_it;
+
+#if defined(RTEMS_SMP)
+ } while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );
+#endif
+
+ *prepend_it_p = prepend_it;
+
+ return priority;
+}
+
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
+ Scheduler_Node *node,
+ Priority_Control new_priority,
+ bool prepend_it
+)
+{
+#if defined(RTEMS_SMP)
+ unsigned int seq;
+
+ seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );
+#endif
+
+ node->Priority.value = new_priority;
+ node->Priority.prepend_it = prepend_it;
+
+#if defined(RTEMS_SMP)
+ _SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );
+#endif
+}
+
+#if defined(RTEMS_SMP)
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
+ const Scheduler_Node *node
+)
+{
+ return node->user;
+}
+
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
+ Scheduler_Node *node,
+ Thread_Control *user
+)
+{
+ node->user = user;
+}
+
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
+ const Scheduler_Node *node
+)
+{
+ return node->idle;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_SCHEDULERNODEIMPL_H */
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index e51c009a95..adb10cbd6f 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -28,6 +28,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/objectimpl.h>
#include <rtems/score/resourceimpl.h>
+#include <rtems/score/schedulernodeimpl.h>
#include <rtems/score/statesimpl.h>
#include <rtems/score/status.h>
#include <rtems/score/sysstate.h>
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 85527c6f70..61d44b8e6a 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -260,6 +260,10 @@ $(PROJECT_INCLUDE)/rtems/score/schedulernode.h: include/rtems/score/schedulernod
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulernode.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulernode.h
+$(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h: include/rtems/score/schedulernodeimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h
+
$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h: include/rtems/score/schedulerpriority.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h