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

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
schedulersimplesmp.h
Go to the documentation of this file.
1
9/*
10 * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 * Copyright (c) 2013, 2018 embedded brains GmbH.
13 *
14 * The license and distribution terms for this file may be
15 * found in the file LICENSE in this distribution or at
16 * http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
20#define _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <rtems/score/scheduler.h>
27#include <rtems/score/schedulerpriority.h>
28#include <rtems/score/schedulersmp.h>
29
54 typedef struct {
55 Scheduler_SMP_Context Base;
56 Chain_Control Ready;
57} Scheduler_simple_SMP_Context;
58
59#define SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY 255
60
64#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
65 { \
66 _Scheduler_simple_SMP_Initialize, \
67 _Scheduler_default_Schedule, \
68 _Scheduler_simple_SMP_Yield, \
69 _Scheduler_simple_SMP_Block, \
70 _Scheduler_simple_SMP_Unblock, \
71 _Scheduler_simple_SMP_Update_priority, \
72 _Scheduler_default_Map_priority, \
73 _Scheduler_default_Unmap_priority, \
74 _Scheduler_simple_SMP_Ask_for_help, \
75 _Scheduler_simple_SMP_Reconsider_help_request, \
76 _Scheduler_simple_SMP_Withdraw_node, \
77 _Scheduler_default_Pin_or_unpin, \
78 _Scheduler_default_Pin_or_unpin, \
79 _Scheduler_simple_SMP_Add_processor, \
80 _Scheduler_simple_SMP_Remove_processor, \
81 _Scheduler_simple_SMP_Node_initialize, \
82 _Scheduler_default_Node_destroy, \
83 _Scheduler_default_Release_job, \
84 _Scheduler_default_Cancel_job, \
85 _Scheduler_default_Tick, \
86 _Scheduler_SMP_Start_idle \
87 SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
88 }
89
95void _Scheduler_simple_SMP_Initialize( const Scheduler_Control *scheduler );
96
105void _Scheduler_simple_SMP_Node_initialize(
106 const Scheduler_Control *scheduler,
107 Scheduler_Node *node,
108 Thread_Control *the_thread,
109 Priority_Control priority
110);
111
119void _Scheduler_simple_SMP_Block(
120 const Scheduler_Control *scheduler,
121 Thread_Control *thread,
122 Scheduler_Node *node
123);
124
132void _Scheduler_simple_SMP_Unblock(
133 const Scheduler_Control *scheduler,
134 Thread_Control *thread,
135 Scheduler_Node *node
136);
137
145void _Scheduler_simple_SMP_Update_priority(
146 const Scheduler_Control *scheduler,
147 Thread_Control *the_thread,
148 Scheduler_Node *node
149);
150
161bool _Scheduler_simple_SMP_Ask_for_help(
162 const Scheduler_Control *scheduler,
163 Thread_Control *the_thread,
164 Scheduler_Node *node
165);
166
175void _Scheduler_simple_SMP_Reconsider_help_request(
176 const Scheduler_Control *scheduler,
177 Thread_Control *the_thread,
178 Scheduler_Node *node
179);
180
190void _Scheduler_simple_SMP_Withdraw_node(
191 const Scheduler_Control *scheduler,
192 Thread_Control *the_thread,
193 Scheduler_Node *node,
194 Thread_Scheduler_state next_state
195);
196
203void _Scheduler_simple_SMP_Add_processor(
204 const Scheduler_Control *scheduler,
205 Thread_Control *idle
206);
207
216 Thread_Control *_Scheduler_simple_SMP_Remove_processor(
217 const Scheduler_Control *scheduler,
218 struct Per_CPU_Control *cpu
219);
220
228void _Scheduler_simple_SMP_Yield(
229 const Scheduler_Control *scheduler,
230 Thread_Control *thread,
231 Scheduler_Node *node
232);
233
236#ifdef __cplusplus
237}
238#endif
239
240#endif
241/* end of include file */
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
_Scheduler_simple_SMP_Node_initialize
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:45
_Scheduler_simple_SMP_Ask_for_help
bool _Scheduler_simple_SMP_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Asks for help.
Definition: schedulersimplesmp.c:280
_Scheduler_simple_SMP_Yield
void _Scheduler_simple_SMP_Yield(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Definition: schedulersimplesmp.c:359
_Scheduler_simple_SMP_Block
void _Scheduler_simple_SMP_Block(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Blocks a thread.
Definition: schedulersimplesmp.c:165
_Scheduler_simple_SMP_Remove_processor
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:344
_Scheduler_simple_SMP_Reconsider_help_request
void _Scheduler_simple_SMP_Reconsider_help_request(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Reconsiders help.
Definition: schedulersimplesmp.c:291
_Scheduler_simple_SMP_Withdraw_node
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:307
_Scheduler_simple_SMP_Unblock
void _Scheduler_simple_SMP_Unblock(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Unblocks a thread.
Definition: schedulersimplesmp.c:224
_Scheduler_simple_SMP_Update_priority
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:260
_Scheduler_simple_SMP_Initialize
void _Scheduler_simple_SMP_Initialize(const Scheduler_Control *scheduler)
Initializes the scheduler's context.
Definition: schedulersimplesmp.c:36
_Scheduler_simple_SMP_Add_processor
void _Scheduler_simple_SMP_Add_processor(const Scheduler_Control *scheduler, Thread_Control *idle)
Adds idle to scheduler.
Definition: schedulersimplesmp.c:328
schedulerpriority.h
Thread Manipulation with the Priority-Based Scheduler.
schedulersmp.h
SMP Scheduler API.
scheduler.h
Constants and Structures Associated with the Scheduler.
Per_CPU_Control
Per CPU Core Structure.
Definition: percpu.h:347
Scheduler_Node
Scheduler node for per-thread data.
Definition: schedulernode.h:79
Scheduler_SMP_Context
Scheduler context specialization for SMP schedulers.
Definition: schedulersmp.h:46
Scheduler_simple_SMP_Context
Definition: schedulersimplesmp.h:54
_Scheduler_Control
Scheduler control.
Definition: scheduler.h:269
_Thread_Control
Definition: thread.h:732
Chain_Control
Definition: chain.h:86