RTEMS
schedulerpriority.c
1 /*
2  * @file
3  *
4  * @brief Initialize Scheduler Priority
5  * @ingroup RTEMSScoreScheduler
6  */
7 
8 /*
9  * Copyright (C) 2010 Gedare Bloom.
10  * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
22 
24 {
27 
30  &context->Ready[ 0 ],
31  scheduler->maximum_priority
32  );
33 }
34 
36  const Scheduler_Control *scheduler,
37  Scheduler_Node *node,
38  Thread_Control *the_thread,
39  Priority_Control priority
40 )
41 {
43  Scheduler_priority_Node *the_node;
44 
45  _Scheduler_Node_do_initialize( scheduler, node, the_thread, priority );
46 
47  context = _Scheduler_priority_Get_context( scheduler );
48  the_node = _Scheduler_priority_Node_downcast( node );
50  &the_node->Ready_queue,
51  SCHEDULER_PRIORITY_UNMAP( priority ),
52  &context->Bit_map,
53  &context->Ready[ 0 ]
54  );
55 }
Chain_Control Ready[0]
One ready queue per priority level.
void _Scheduler_priority_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes the node with the given priority.
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
void _Scheduler_priority_Initialize(const Scheduler_Control *scheduler)
Initializes the priority scheduler.
static __inline__ Scheduler_priority_Context * _Scheduler_priority_Get_context(const Scheduler_Control *scheduler)
Gets the context of the scheduler.
Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures...
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize(Priority_bit_map_Control *bit_map)
Initializes a bit map.
static __inline__ void _Scheduler_priority_Ready_queue_initialize(Chain_Control *ready_queues, Priority_Control maximum_priority)
Ready queue initialization.
static __inline__ void _Scheduler_priority_Ready_queue_update(Scheduler_priority_Ready_queue *ready_queue, unsigned int new_priority, Priority_bit_map_Control *bit_map, Chain_Control *ready_queues)
Updates the specified ready queue data according to the new priority value.
Priority_bit_map_Control Bit_map
Bit map to indicate non-empty ready queues.
Scheduler_priority_Ready_queue Ready_queue
The associated ready queue of this node.
Priority_Control maximum_priority
The maximum priority value of this scheduler.
Definition: scheduler.h:281
static __inline__ Scheduler_priority_Node * _Scheduler_priority_Node_downcast(Scheduler_Node *node)
Gets the priority node of the scheduler node.
static __inline__ void _Scheduler_Node_do_initialize(const struct _Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes a node.
#define SCHEDULER_PRIORITY_UNMAP(priority)
Returns the plain priority value.
Scheduler node specialization for Deterministic Priority schedulers.
Scheduler control.
Definition: scheduler.h:264
Scheduler node for per-thread data.
Definition: schedulernode.h:79