RTEMS 6.1-rc5
Loading...
Searching...
No Matches
schedulersimplesmp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
14 *
15 * Copyright (C) 2013, 2018 embedded brains GmbH & Co. KG
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
40#define _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
49
74typedef struct {
76 Chain_Control Ready;
78
79#define SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY 255
80
84#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
85 { \
86 _Scheduler_simple_SMP_Initialize, \
87 _Scheduler_default_Schedule, \
88 _Scheduler_simple_SMP_Yield, \
89 _Scheduler_simple_SMP_Block, \
90 _Scheduler_simple_SMP_Unblock, \
91 _Scheduler_simple_SMP_Update_priority, \
92 _Scheduler_default_Map_priority, \
93 _Scheduler_default_Unmap_priority, \
94 _Scheduler_simple_SMP_Ask_for_help, \
95 _Scheduler_simple_SMP_Reconsider_help_request, \
96 _Scheduler_simple_SMP_Withdraw_node, \
97 _Scheduler_simple_SMP_Make_sticky, \
98 _Scheduler_simple_SMP_Clean_sticky, \
99 _Scheduler_default_Pin_or_unpin_not_supported, \
100 _Scheduler_default_Pin_or_unpin_not_supported, \
101 _Scheduler_simple_SMP_Add_processor, \
102 _Scheduler_simple_SMP_Remove_processor, \
103 _Scheduler_simple_SMP_Node_initialize, \
104 _Scheduler_default_Node_destroy, \
105 _Scheduler_default_Release_job, \
106 _Scheduler_default_Cancel_job, \
107 _Scheduler_SMP_Start_idle \
108 SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
109 }
110
117
127 const Scheduler_Control *scheduler,
128 Scheduler_Node *node,
129 Thread_Control *the_thread,
130 Priority_Control priority
131);
132
141 const Scheduler_Control *scheduler,
142 Thread_Control *thread,
143 Scheduler_Node *node
144);
145
154 const Scheduler_Control *scheduler,
155 Thread_Control *thread,
156 Scheduler_Node *node
157);
158
167 const Scheduler_Control *scheduler,
168 Thread_Control *the_thread,
169 Scheduler_Node *node
170);
171
183 const Scheduler_Control *scheduler,
184 Thread_Control *the_thread,
185 Scheduler_Node *node
186);
187
197 const Scheduler_Control *scheduler,
198 Thread_Control *the_thread,
199 Scheduler_Node *node
200);
201
212 const Scheduler_Control *scheduler,
213 Thread_Control *the_thread,
214 Scheduler_Node *node,
215 Thread_Scheduler_state next_state
216);
217
228 const Scheduler_Control *scheduler,
229 Thread_Control *the_thread,
230 Scheduler_Node *node
231);
232
243 const Scheduler_Control *scheduler,
244 Thread_Control *the_thread,
245 Scheduler_Node *node
246);
247
255 const Scheduler_Control *scheduler,
256 Thread_Control *idle
257);
258
268 const Scheduler_Control *scheduler,
269 struct Per_CPU_Control *cpu
270);
271
280 const Scheduler_Control *scheduler,
281 Thread_Control *thread,
282 Scheduler_Node *node
283);
284
287#ifdef __cplusplus
288}
289#endif
290
291#endif
292/* end of include file */
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:91
void _Scheduler_simple_SMP_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes the node with the given attributes.
Definition: schedulersimplesmp.c:74
void _Scheduler_simple_SMP_Make_sticky(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Makes the node sticky.
Definition: schedulersimplesmp.c:392
bool _Scheduler_simple_SMP_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Asks for help.
Definition: schedulersimplesmp.c:342
void _Scheduler_simple_SMP_Yield(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Definition: schedulersimplesmp.c:461
void _Scheduler_simple_SMP_Block(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Blocks a thread.
Definition: schedulersimplesmp.c:218
Thread_Control * _Scheduler_simple_SMP_Remove_processor(const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
Removes an idle thread from the given cpu.
Definition: schedulersimplesmp.c:443
void _Scheduler_simple_SMP_Reconsider_help_request(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Reconsiders help.
Definition: schedulersimplesmp.c:353
void _Scheduler_simple_SMP_Clean_sticky(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Cleans the sticky property from the node.
Definition: schedulersimplesmp.c:407
void _Scheduler_simple_SMP_Withdraw_node(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
Withdraws node.
Definition: schedulersimplesmp.c:369
void _Scheduler_simple_SMP_Unblock(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Unblocks a thread.
Definition: schedulersimplesmp.c:283
void _Scheduler_simple_SMP_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Updates the priority of the node.
Definition: schedulersimplesmp.c:321
void _Scheduler_simple_SMP_Initialize(const Scheduler_Control *scheduler)
Initializes the scheduler's context.
Definition: schedulersimplesmp.c:65
void _Scheduler_simple_SMP_Add_processor(const Scheduler_Control *scheduler, Thread_Control *idle)
Adds idle to scheduler.
Definition: schedulersimplesmp.c:427
This header file provides interfaces of the Deterministic Priority Scheduler which are used by the im...
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...
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
Definition: schedulersimplesmp.h:74
Scheduler control.
Definition: scheduler.h:337
Definition: thread.h:837
This union represents a chain control block.
Definition: chain.h:96