1 | /** |
---|
2 | * @file rtems/score/schedulersimple.h |
---|
3 | * |
---|
4 | * @brief Manipulation of Threads Simple-Priority-Based Ready Queue |
---|
5 | * |
---|
6 | * This include file contains all the constants and structures associated |
---|
7 | * with the manipulation of threads on a simple-priority-based ready queue. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * Copyright (C) 2011 On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_H |
---|
19 | #define _RTEMS_SCORE_SCHEDULERSIMPLE_H |
---|
20 | |
---|
21 | #include <rtems/score/scheduler.h> |
---|
22 | #include <rtems/score/schedulerpriority.h> |
---|
23 | |
---|
24 | #ifdef __cplusplus |
---|
25 | extern "C" { |
---|
26 | #endif |
---|
27 | |
---|
28 | /** |
---|
29 | * @defgroup ScoreSchedulerSimple Simple Priority Scheduler |
---|
30 | * |
---|
31 | * @ingroup ScoreScheduler |
---|
32 | */ |
---|
33 | /**@{*/ |
---|
34 | |
---|
35 | #define SCHEDULER_SIMPLE_MAXIMUM_PRIORITY 255 |
---|
36 | |
---|
37 | /** |
---|
38 | * Entry points for Scheduler Simple |
---|
39 | */ |
---|
40 | #define SCHEDULER_SIMPLE_ENTRY_POINTS \ |
---|
41 | { \ |
---|
42 | _Scheduler_simple_Initialize, /* initialize entry point */ \ |
---|
43 | _Scheduler_simple_Schedule, /* schedule entry point */ \ |
---|
44 | _Scheduler_simple_Yield, /* yield entry point */ \ |
---|
45 | _Scheduler_simple_Block, /* block entry point */ \ |
---|
46 | _Scheduler_simple_Unblock, /* unblock entry point */ \ |
---|
47 | _Scheduler_simple_Update_priority, /* update priority entry point */ \ |
---|
48 | _Scheduler_default_Map_priority, /* map priority entry point */ \ |
---|
49 | _Scheduler_default_Unmap_priority, /* unmap priority entry point */ \ |
---|
50 | SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \ |
---|
51 | _Scheduler_default_Node_initialize, /* node initialize entry point */ \ |
---|
52 | _Scheduler_default_Node_destroy, /* node destroy entry point */ \ |
---|
53 | _Scheduler_default_Release_job, /* new period of task */ \ |
---|
54 | _Scheduler_default_Cancel_job, /* cancel period of task */ \ |
---|
55 | _Scheduler_default_Tick, /* tick entry point */ \ |
---|
56 | _Scheduler_default_Start_idle /* start idle entry point */ \ |
---|
57 | SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \ |
---|
58 | } |
---|
59 | |
---|
60 | /** |
---|
61 | * @brief Simple scheduler context. |
---|
62 | */ |
---|
63 | typedef struct { |
---|
64 | /** |
---|
65 | * @brief Basic scheduler context. |
---|
66 | */ |
---|
67 | Scheduler_Context Base; |
---|
68 | |
---|
69 | /** |
---|
70 | * @brief One ready queue for all ready threads. |
---|
71 | */ |
---|
72 | Chain_Control Ready; |
---|
73 | } Scheduler_simple_Context; |
---|
74 | |
---|
75 | /** |
---|
76 | * @brief Initialize simple scheduler. |
---|
77 | * |
---|
78 | * This routine initializes the simple scheduler. |
---|
79 | */ |
---|
80 | void _Scheduler_simple_Initialize( const Scheduler_Control *scheduler ); |
---|
81 | |
---|
82 | /** |
---|
83 | * This routine sets the heir thread to be the next ready thread |
---|
84 | * on the ready queue by getting the first node in the scheduler |
---|
85 | * information. |
---|
86 | * |
---|
87 | * @param[in] scheduler The scheduler instance. |
---|
88 | * @param[in] the_thread causing the scheduling operation. |
---|
89 | */ |
---|
90 | void _Scheduler_simple_Schedule( |
---|
91 | const Scheduler_Control *scheduler, |
---|
92 | Thread_Control *the_thread |
---|
93 | ); |
---|
94 | |
---|
95 | void _Scheduler_simple_Yield( |
---|
96 | const Scheduler_Control *scheduler, |
---|
97 | Thread_Control *the_thread, |
---|
98 | Scheduler_Node *node |
---|
99 | ); |
---|
100 | |
---|
101 | void _Scheduler_simple_Block( |
---|
102 | const Scheduler_Control *scheduler, |
---|
103 | Thread_Control *the_thread, |
---|
104 | Scheduler_Node *node |
---|
105 | ); |
---|
106 | |
---|
107 | void _Scheduler_simple_Unblock( |
---|
108 | const Scheduler_Control *scheduler, |
---|
109 | Thread_Control *the_thread, |
---|
110 | Scheduler_Node *node |
---|
111 | ); |
---|
112 | |
---|
113 | void _Scheduler_simple_Update_priority( |
---|
114 | const Scheduler_Control *scheduler, |
---|
115 | Thread_Control *the_thread, |
---|
116 | Scheduler_Node *node |
---|
117 | ); |
---|
118 | |
---|
119 | /**@}*/ |
---|
120 | |
---|
121 | #ifdef __cplusplus |
---|
122 | } |
---|
123 | #endif |
---|
124 | |
---|
125 | #endif |
---|
126 | /* end of include file */ |
---|