summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/schedulernodeimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/include/rtems/score/schedulernodeimpl.h')
-rw-r--r--cpukit/include/rtems/score/schedulernodeimpl.h70
1 files changed, 52 insertions, 18 deletions
diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h
index e222de953b..db14184723 100644
--- a/cpukit/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/include/rtems/score/schedulernodeimpl.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -9,17 +11,28 @@
*/
/*
- * Copyright (c) 2014, 2017 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2014, 2017 embedded brains GmbH & Co. KG
*
- * embedded brains GmbH
- * Dornierstr. 4
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_SCORE_SCHEDULERNODEIMPL_H
@@ -87,7 +100,7 @@ extern "C" {
*
* @param priority is the initial priority of the node.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
+static inline void _Scheduler_Node_do_initialize(
const struct _Scheduler_Control *scheduler,
Scheduler_Node *node,
Thread_Control *the_thread,
@@ -119,7 +132,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
*
* @param[in, out] node is the node to destroy.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_destroy(
+static inline void _Scheduler_Node_do_destroy(
const struct _Scheduler_Control *scheduler,
Scheduler_Node *node
)
@@ -140,7 +153,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_destroy(
*
* @return The scheduler of the node.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
+static inline const Scheduler_Control *_Scheduler_Node_get_scheduler(
const Scheduler_Node *node
)
{
@@ -154,7 +167,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
*
* @return The owner of the node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
+static inline Thread_Control *_Scheduler_Node_get_owner(
const Scheduler_Node *node
)
{
@@ -168,7 +181,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
*
* @return The priority of the node.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
+static inline Priority_Control _Scheduler_Node_get_priority(
Scheduler_Node *node
)
{
@@ -201,7 +214,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
* @param group_order is the priority group order, see #PRIORITY_GROUP_FIRST
* and #PRIORITY_GROUP_LAST.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
+static inline void _Scheduler_Node_set_priority(
Scheduler_Node *node,
Priority_Control new_priority,
Priority_Group_order group_order
@@ -230,7 +243,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
*
* @return The user of the node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
+static inline Thread_Control *_Scheduler_Node_get_user(
const Scheduler_Node *node
)
{
@@ -243,7 +256,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
* @param[out] node The node to set the user of.
* @param user The new user for @a node.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
+static inline void _Scheduler_Node_set_user(
Scheduler_Node *node,
Thread_Control *user
)
@@ -258,12 +271,33 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
*
* @return The idle thread of @a node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
+static inline Thread_Control *_Scheduler_Node_get_idle(
const Scheduler_Node *node
)
{
return node->idle;
}
+
+/**
+ * @brief Sets the scheduler node's user to the idle thread.
+ *
+ * @param[in, out] node is the node to receive an idle thread.
+ *
+ * @param idle is the idle thread to use.
+ */
+static inline void _Scheduler_Node_set_idle_user(
+ Scheduler_Node *node,
+ Thread_Control *idle
+)
+{
+ _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+ _Assert(
+ _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
+ );
+
+ _Scheduler_Node_set_user( node, idle );
+ node->idle = idle;
+}
#endif
#ifdef __cplusplus