RTEMS: cpukit/include/rtems/score/schedulerpriority.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
schedulerpriority.h
Go to the documentation of this file.
1
12/*
13 * Copryight (c) 2010 Gedare Bloom.
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_SCHEDULERPRIORITY_H
22#define _RTEMS_SCORE_SCHEDULERPRIORITY_H
23
24#include <rtems/score/chain.h>
25#include <rtems/score/prioritybitmap.h>
26#include <rtems/score/scheduler.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
45#define SCHEDULER_PRIORITY_ENTRY_POINTS \
46 { \
47 _Scheduler_priority_Initialize, /* initialize entry point */ \
48 _Scheduler_priority_Schedule, /* schedule entry point */ \
49 _Scheduler_priority_Yield, /* yield entry point */ \
50 _Scheduler_priority_Block, /* block entry point */ \
51 _Scheduler_priority_Unblock, /* unblock entry point */ \
52 _Scheduler_priority_Update_priority, /* update priority entry point */ \
53 _Scheduler_default_Map_priority, /* map priority entry point */ \
54 _Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
55 SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
56 _Scheduler_priority_Node_initialize, /* node initialize entry point */ \
57 _Scheduler_default_Node_destroy, /* node destroy entry point */ \
58 _Scheduler_default_Release_job, /* new period of task */ \
59 _Scheduler_default_Cancel_job, /* cancel period of task */ \
60 _Scheduler_default_Tick, /* tick entry point */ \
61 _Scheduler_default_Start_idle /* start idle entry point */ \
62 SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
63 }
64
65 typedef struct {
69 Scheduler_Context Base;
70
74 Priority_bit_map_Control Bit_map;
75
79 Chain_Control Ready[ 0 ];
80} Scheduler_priority_Context;
81
85 typedef struct {
89 unsigned int current_priority;
90
92 Chain_Control *ready_chain;
93
95 Priority_bit_map_Information Priority_map;
96} Scheduler_priority_Ready_queue;
97
101 typedef struct {
105 Scheduler_Node Base;
106
110 Scheduler_priority_Ready_queue Ready_queue;
111} Scheduler_priority_Node;
112
120void _Scheduler_priority_Initialize( const Scheduler_Control *scheduler );
121
129void _Scheduler_priority_Block(
130 const Scheduler_Control *scheduler,
131 Thread_Control *the_thread,
132 Scheduler_Node *node
133);
134
144void _Scheduler_priority_Schedule(
145 const Scheduler_Control *scheduler,
146 Thread_Control *the_thread
147);
148
156void _Scheduler_priority_Unblock(
157 const Scheduler_Control *scheduler,
158 Thread_Control *the_thread,
159 Scheduler_Node *node
160);
161
169void _Scheduler_priority_Update_priority(
170 const Scheduler_Control *scheduler,
171 Thread_Control *the_thread,
172 Scheduler_Node *base_node
173);
174
183void _Scheduler_priority_Node_initialize(
184 const Scheduler_Control *scheduler,
185 Scheduler_Node *node,
186 Thread_Control *the_thread,
187 Priority_Control priority
188);
189
197void _Scheduler_priority_Yield(
198 const Scheduler_Control *scheduler,
199 Thread_Control *the_thread,
200 Scheduler_Node *node
201);
202
205#ifdef __cplusplus
206}
207#endif
208
209#endif
210/* end of include file */
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
_Scheduler_priority_Node_initialize
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.
Definition: schedulerpriority.c:35
_Scheduler_priority_Block
void _Scheduler_priority_Block(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Blocks the thread.
Definition: schedulerpriorityblock.c:26
_Scheduler_priority_Unblock
void _Scheduler_priority_Unblock(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Unblocks the thread.
Definition: schedulerpriorityunblock.c:25
_Scheduler_priority_Yield
void _Scheduler_priority_Yield(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Performs the yield of a thread.
Definition: schedulerpriorityyield.c:24
_Scheduler_priority_Schedule
void _Scheduler_priority_Schedule(const Scheduler_Control *scheduler, Thread_Control *the_thread)
Sets the heir thread to be the next ready thread.
Definition: schedulerpriorityschedule.c:24
_Scheduler_priority_Initialize
void _Scheduler_priority_Initialize(const Scheduler_Control *scheduler)
Initializes the priority scheduler.
Definition: schedulerpriority.c:23
_Scheduler_priority_Update_priority
void _Scheduler_priority_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *base_node)
Updates the priority of the node.
Definition: schedulerprioritychangepriority.c:24
prioritybitmap.h
Manipulation Routines for the Bitmap Priority Queue Implementation.
chain.h
Chain Handler API.
scheduler.h
Constants and Structures Associated with the Scheduler.
Priority_bit_map_Control
Definition: prioritybitmap.h:42
Priority_bit_map_Information
Definition: prioritybitmap.h:64
Scheduler_Context
Scheduler context.
Definition: scheduler.h:252
Scheduler_Node
Scheduler node for per-thread data.
Definition: schedulernode.h:79
Scheduler_priority_Context
Definition: schedulerpriority.h:65
Scheduler_priority_Context::Bit_map
Priority_bit_map_Control Bit_map
Bit map to indicate non-empty ready queues.
Definition: schedulerpriority.h:74
Scheduler_priority_Context::Base
Scheduler_Context Base
Basic scheduler context.
Definition: schedulerpriority.h:69
Scheduler_priority_Node
Scheduler node specialization for Deterministic Priority schedulers.
Definition: schedulerpriority.h:101
Scheduler_priority_Node::Ready_queue
Scheduler_priority_Ready_queue Ready_queue
The associated ready queue of this node.
Definition: schedulerpriority.h:110
Scheduler_priority_Node::Base
Scheduler_Node Base
Basic scheduler node.
Definition: schedulerpriority.h:105
Scheduler_priority_Ready_queue
Data for ready queue operations.
Definition: schedulerpriority.h:85
Scheduler_priority_Ready_queue::current_priority
unsigned int current_priority
The thread priority currently used by the scheduler.
Definition: schedulerpriority.h:89
Scheduler_priority_Ready_queue::ready_chain
Chain_Control * ready_chain
Definition: schedulerpriority.h:92
Scheduler_priority_Ready_queue::Priority_map
Priority_bit_map_Information Priority_map
Definition: schedulerpriority.h:95
_Scheduler_Control
Scheduler control.
Definition: scheduler.h:269
_Thread_Control
Definition: thread.h:732
Chain_Control
Definition: chain.h:86