RTEMS  5.1
schedulersimpleimpl.h
Go to the documentation of this file.
1 
13 /*
14  * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
15  *
16  * The license and distribution terms for this file may be
17  * found in the file LICENSE in this distribution or at
18  * http://www.rtems.org/license/LICENSE.
19  */
20 
21 #ifndef _RTEMS_SCORE_SCHEDULERSIMPLEIMPL_H
22 #define _RTEMS_SCORE_SCHEDULERSIMPLEIMPL_H
23 
25 #include <rtems/score/chainimpl.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
47 {
48  return (Scheduler_simple_Context *) _Scheduler_Get_context( scheduler );
49 }
50 
61  const void *to_insert,
62  const Chain_Node *next
63 )
64 {
65  const unsigned int *priority_to_insert;
66  const Thread_Control *thread_next;
67 
68  priority_to_insert = (const unsigned int *) to_insert;
69  thread_next = (const Thread_Control *) next;
70 
71  return *priority_to_insert <= _Thread_Get_priority( thread_next );
72 }
73 
82  Chain_Control *chain,
83  Thread_Control *to_insert,
84  unsigned int insert_priority
85 )
86 {
88  chain,
89  &to_insert->Object.Node,
90  &insert_priority,
92  );
93 }
94 
103  const Scheduler_Control *scheduler,
104  Thread_Control *the_thread,
105  Scheduler_Node *node
106 )
107 {
108  (void) scheduler;
109  (void) node;
110 
111  _Chain_Extract_unprotected( &the_thread->Object.Node );
112 }
113 
125  const Scheduler_Control *scheduler,
126  Thread_Control *the_thread,
127  bool force_dispatch
128 )
129 {
131  _Scheduler_simple_Get_context( scheduler );
132  Thread_Control *heir = (Thread_Control *) _Chain_First( &context->Ready );
133 
134  ( void ) the_thread;
135 
136  _Scheduler_Update_heir( heir, force_dispatch );
137 }
138 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif
146 /* end of include file */
RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_less_equal(const void *to_insert, const Chain_Node *next)
Checks if the priority is less or equal than the priority of the node.
Definition: schedulersimpleimpl.h:60
Definition: chain.h:68
RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(Chain_Node *the_node)
Extracts this node (unprotected).
Definition: chainimpl.h:558
RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Extracts the threads node.
Definition: schedulersimpleimpl.h:102
RTEMS_INLINE_ROUTINE Scheduler_Context * _Scheduler_Get_context(const Scheduler_Control *scheduler)
Gets the context of the scheduler.
Definition: schedulerimpl.h:58
Inlined Routines Associated with the Manipulation of the Scheduler.
Definition: chain.h:86
RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert(Chain_Control *chain, Thread_Control *to_insert, unsigned int insert_priority)
Inserts the thread control with the given priority into the chain.
Definition: schedulersimpleimpl.h:81
Simple scheduler context.
Definition: schedulersimple.h:68
Manipulation of Threads Simple-Priority-Based Ready Queue.
RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(Thread_Control *new_heir, bool force_dispatch)
Updates the heir.
Definition: schedulerimpl.h:1184
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_First(const Chain_Control *the_chain)
Returns pointer to chain's first node.
Definition: chainimpl.h:260
Definition: thread.h:732
RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body(const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch)
Scheduling decision logic.
Definition: schedulersimpleimpl.h:124
Chain_Node Node
Definition: objectdata.h:41
Objects_Control Object
Definition: thread.h:734
Chain Handler API.
RTEMS_INLINE_ROUTINE void _Chain_Insert_ordered_unprotected(Chain_Control *the_chain, Chain_Node *to_insert, const void *left, Chain_Node_order order)
Inserts a node into the chain according to the order relation.
Definition: chainimpl.h:864
unsigned context
Definition: tlb.h:108
Scheduler control.
Definition: scheduler.h:269
Scheduler node for per-thread data.
Definition: schedulernode.h:79
RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority(const Thread_Control *the_thread)
Returns the priority of the thread.
Definition: threadimpl.h:1584
RTEMS_INLINE_ROUTINE Scheduler_simple_Context * _Scheduler_simple_Get_context(const Scheduler_Control *scheduler)
Gets context of the scheduler.
Definition: schedulersimpleimpl.h:46
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66