RTEMS 6.1-rc6
Loading...
Searching...
No Matches
schedulerstrongapa.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2020 Richi Dubey
14 * Copyright (C) 2013, 2018 embedded brains GmbH & Co. KG
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_SCORE_SCHEDULERSTRONGAPA_H
39#define _RTEMS_SCORE_SCHEDULERSTRONGAPA_H
40
43
44#ifdef __cplusplus
45extern "C" {
46#endif /* __cplusplus */
47
48/* Forward Declaration of Per_CPU_Control */
49struct Per_CPU_Control;
50
74typedef struct {
79
84
91
95 Processor_mask Affinity;
97
98
102typedef struct {
107
112
118
124
128typedef struct {
133
139
145
146#define SCHEDULER_STRONG_APA_MAXIMUM_PRIORITY 255
147
151#define SCHEDULER_STRONG_APA_ENTRY_POINTS \
152 { \
153 _Scheduler_strong_APA_Initialize, \
154 _Scheduler_default_Schedule, \
155 _Scheduler_strong_APA_Yield, \
156 _Scheduler_strong_APA_Block, \
157 _Scheduler_strong_APA_Unblock, \
158 _Scheduler_strong_APA_Update_priority, \
159 _Scheduler_default_Map_priority, \
160 _Scheduler_default_Unmap_priority, \
161 _Scheduler_strong_APA_Ask_for_help, \
162 _Scheduler_strong_APA_Reconsider_help_request, \
163 _Scheduler_strong_APA_Withdraw_node, \
164 _Scheduler_strong_APA_Make_sticky, \
165 _Scheduler_strong_APA_Clean_sticky, \
166 _Scheduler_default_Pin_or_unpin_not_supported, \
167 _Scheduler_default_Pin_or_unpin_not_supported, \
168 _Scheduler_strong_APA_Add_processor, \
169 _Scheduler_strong_APA_Remove_processor, \
170 _Scheduler_strong_APA_Node_initialize, \
171 _Scheduler_default_Node_destroy, \
172 _Scheduler_default_Release_job, \
173 _Scheduler_default_Cancel_job, \
174 _Scheduler_strong_APA_Start_idle, \
175 _Scheduler_strong_APA_Set_affinity \
176 }
177
184
194 const Scheduler_Control *scheduler,
195 Scheduler_Node *node,
196 Thread_Control *the_thread,
197 Priority_Control priority
198);
199
208 const Scheduler_Control *scheduler,
209 Thread_Control *the_thread,
210 Scheduler_Node *node
211);
212
221 const Scheduler_Control *scheduler,
222 Thread_Control *the_thread,
223 Scheduler_Node *node
224);
225
234 const Scheduler_Control *scheduler,
235 Thread_Control *the_thread,
236 Scheduler_Node *node
237);
238
250 const Scheduler_Control *scheduler,
251 Thread_Control *the_thread,
252 Scheduler_Node *node
253);
254
263 const Scheduler_Control *scheduler,
264 Thread_Control *the_thread,
265 Scheduler_Node *node
266);
267
277 const Scheduler_Control *scheduler,
278 Thread_Control *the_thread,
279 Scheduler_Node *node,
280 Thread_Scheduler_state next_state
281);
282
293 const Scheduler_Control *scheduler,
294 Thread_Control *the_thread,
295 Scheduler_Node *node
296);
297
308 const Scheduler_Control *scheduler,
309 Thread_Control *the_thread,
310 Scheduler_Node *node
311);
312
323 const Scheduler_Control *scheduler,
324 Thread_Control *the_thread,
325 Scheduler_Node *node
326);
327
338 const Scheduler_Control *scheduler,
339 Thread_Control *the_thread,
340 Scheduler_Node *node
341);
342
350 const Scheduler_Control *scheduler,
351 Thread_Control *idle
352);
353
363 const Scheduler_Control *scheduler,
364 struct Per_CPU_Control *cpu
365);
366
375 const Scheduler_Control *scheduler,
376 Thread_Control *the_thread,
377 Scheduler_Node *node
378);
379
388 const Scheduler_Control *scheduler,
389 Thread_Control *idle,
390 struct Per_CPU_Control *cpu
391);
392
401 const Scheduler_Control *scheduler,
402 Thread_Control *thread,
403 Scheduler_Node *node_base,
404 const Processor_mask *affinity
405);
406
409#ifdef __cplusplus
410}
411#endif /* __cplusplus */
412
413#endif /* _RTEMS_SCORE_SCHEDULERSTRONGAPA_H */
#define RTEMS_ZERO_LENGTH_ARRAY
This constant represents the element count of a zero-length array.
Definition: basedefs.h:1032
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:91
void _Scheduler_strong_APA_Yield(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Performs a yield operation.
Definition: schedulerstrongapa.c:879
Thread_Control * _Scheduler_strong_APA_Remove_processor(const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
Removes an idle thread from the given cpu.
Definition: schedulerstrongapa.c:1101
void _Scheduler_strong_APA_Block(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Blocks the thread.
Definition: schedulerstrongapa.c:898
void _Scheduler_strong_APA_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes the node with the given priority.
Definition: schedulerstrongapa.c:1119
void _Scheduler_strong_APA_Make_sticky(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Makes the node sticky.
Definition: schedulerstrongapa.c:1020
void _Scheduler_strong_APA_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Updates the priority of the node.
Definition: schedulerstrongapa.c:945
Status_Control _Scheduler_strong_APA_Set_affinity(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node_base, const Processor_mask *affinity)
Sets the affinity .
Definition: schedulerstrongapa.c:1140
void _Scheduler_strong_APA_Add_processor(const Scheduler_Control *scheduler, Thread_Control *idle)
Adds the idle thread to a processor.
Definition: schedulerstrongapa.c:1067
void _Scheduler_strong_APA_Unblock(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Unblocks the thread.
Definition: schedulerstrongapa.c:927
void _Scheduler_strong_APA_Reconsider_help_request(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Reconsiders help request.
Definition: schedulerstrongapa.c:981
void _Scheduler_strong_APA_sticky(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Cleans the sticky property from the node.
void _Scheduler_strong_APA_Start_idle(const Scheduler_Control *scheduler, Thread_Control *idle, struct Per_CPU_Control *cpu)
Starts an idle thread.
Definition: schedulerstrongapa.c:1083
bool _Scheduler_strong_APA_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Asks for help.
Definition: schedulerstrongapa.c:966
void _Scheduler_strong_APA_Clean_sticky(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Cleans the sticky property from the node.
Definition: schedulerstrongapa.c:1035
void _Scheduler_strong_APA_Withdraw_node(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
Withdraws the node.
Definition: schedulerstrongapa.c:997
void _Scheduler_strong_APA_Initialize(const Scheduler_Control *scheduler)
Initializes the scheduler.
Definition: schedulerstrongapa.c:870
Status_Control
Status codes.
Definition: status.h:111
This header file provides interfaces of the SMP Scheduler which are used by the implementation and th...
This header file provides interfaces of the Scheduler Handler which are used by the implementation an...
This structure represents a chain node.
Definition: chain.h:78
Per CPU Core Structure.
Definition: percpu.h:384
Scheduler node for per-thread data.
Definition: schedulernode.h:94
Scheduler context specialization for SMP schedulers.
Definition: schedulersmp.h:61
Scheduler node specialization for SMP schedulers.
Definition: schedulersmp.h:106
CPU related variables and a CPU_Control to implement BFS.
Definition: schedulerstrongapa.h:102
bool visited
Whether or not this cpu has been added to the queue (visited in BFS).
Definition: schedulerstrongapa.h:117
Scheduler_Node * preempting_node
The node that would preempt this CPU.
Definition: schedulerstrongapa.h:111
struct Per_CPU_Control * cpu
CPU in a queue.
Definition: schedulerstrongapa.h:106
Scheduler_Node * executing
The node currently executing on this cpu.
Definition: schedulerstrongapa.h:122
Scheduler context and node definition for Strong APA scheduler.
Definition: schedulerstrongapa.h:128
Chain_Control Ready
Chain of all the ready and scheduled nodes present in the Strong APA scheduler.
Definition: schedulerstrongapa.h:138
Scheduler_SMP_Context Base
Definition: schedulerstrongapa.h:132
Scheduler node specialization for Strong APA schedulers.
Definition: schedulerstrongapa.h:74
Chain_Node Ready_node
Chain node for Scheduler_strong_APA_Context::Ready.
Definition: schedulerstrongapa.h:83
Processor_mask Affinity
The associated affinity set of this node.
Definition: schedulerstrongapa.h:95
struct Per_CPU_Control * cpu_to_preempt
CPU that this node would preempt in the backtracking part of _Scheduler_strong_APA_Get_highest_ready ...
Definition: schedulerstrongapa.h:90
Scheduler_SMP_Node Base
SMP scheduler node.
Definition: schedulerstrongapa.h:78
Scheduler control.
Definition: scheduler.h:337
Definition: thread.h:837
This union represents a chain control block.
Definition: chain.h:96