RTEMS 6.1-rc1
schedulerpriority.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
13/*
14 * Copryight (c) 2010 Gedare Bloom.
15 * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
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_SCHEDULERPRIORITY_H
40#define _RTEMS_SCORE_SCHEDULERPRIORITY_H
41
42#include <rtems/score/chain.h>
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
64#define SCHEDULER_PRIORITY_ENTRY_POINTS \
65 { \
66 _Scheduler_priority_Initialize, /* initialize entry point */ \
67 _Scheduler_priority_Schedule, /* schedule entry point */ \
68 _Scheduler_priority_Yield, /* yield entry point */ \
69 _Scheduler_priority_Block, /* block entry point */ \
70 _Scheduler_priority_Unblock, /* unblock entry point */ \
71 _Scheduler_priority_Update_priority, /* update priority entry point */ \
72 _Scheduler_default_Map_priority, /* map priority entry point */ \
73 _Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
74 SCHEDULER_DEFAULT_SMP_OPERATIONS \
75 _Scheduler_priority_Node_initialize, /* node initialize entry point */ \
76 _Scheduler_default_Node_destroy, /* node destroy entry point */ \
77 _Scheduler_default_Release_job, /* new period of task */ \
78 _Scheduler_default_Cancel_job, /* cancel period of task */ \
79 _Scheduler_default_Start_idle /* start idle entry point */ \
80 SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
81 }
82
83typedef struct {
88
93
99
103typedef struct {
107 unsigned int current_priority;
108
111
115
119typedef struct {
124
130
139
148 const Scheduler_Control *scheduler,
149 Thread_Control *the_thread,
150 Scheduler_Node *node
151);
152
163 const Scheduler_Control *scheduler,
164 Thread_Control *the_thread
165);
166
175 const Scheduler_Control *scheduler,
176 Thread_Control *the_thread,
177 Scheduler_Node *node
178);
179
188 const Scheduler_Control *scheduler,
189 Thread_Control *the_thread,
190 Scheduler_Node *base_node
191);
192
202 const Scheduler_Control *scheduler,
203 Scheduler_Node *node,
204 Thread_Control *the_thread,
205 Priority_Control priority
206);
207
216 const Scheduler_Control *scheduler,
217 Thread_Control *the_thread,
218 Scheduler_Node *node
219);
220
223#ifdef __cplusplus
224}
225#endif
226
227#endif
228/* end of include file */
#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_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:57
void _Scheduler_priority_Block(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Blocks the thread.
Definition: schedulerpriorityblock.c:46
void _Scheduler_priority_Unblock(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Unblocks the thread.
Definition: schedulerpriorityunblock.c:46
void _Scheduler_priority_Yield(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Performs the yield of a thread.
Definition: schedulerpriorityyield.c:45
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:44
void _Scheduler_priority_Initialize(const Scheduler_Control *scheduler)
Initializes the priority scheduler.
Definition: schedulerpriority.c:45
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:44
This header file provides interfaces of the Priority Bitmap which are used by the implementation and ...
This header file provides interfaces of the Chain Handler which are used by the implementation and th...
This header file provides interfaces of the Scheduler Handler which are used by the implementation an...
Definition: prioritybitmap.h:60
Definition: prioritybitmap.h:82
Scheduler context.
Definition: scheduler.h:318
Scheduler node for per-thread data.
Definition: schedulernode.h:94
Definition: schedulerpriority.h:83
Priority_bit_map_Control Bit_map
Bit map to indicate non-empty ready queues.
Definition: schedulerpriority.h:92
Scheduler_Context Base
Basic scheduler context.
Definition: schedulerpriority.h:87
Scheduler node specialization for Deterministic Priority schedulers.
Definition: schedulerpriority.h:119
Scheduler_priority_Ready_queue Ready_queue
The associated ready queue of this node.
Definition: schedulerpriority.h:128
Scheduler_Node Base
Basic scheduler node.
Definition: schedulerpriority.h:123
Data for ready queue operations.
Definition: schedulerpriority.h:103
unsigned int current_priority
The thread priority currently used by the scheduler.
Definition: schedulerpriority.h:107
Chain_Control * ready_chain
Definition: schedulerpriority.h:110
Priority_bit_map_Information Priority_map
Definition: schedulerpriority.h:113
Scheduler control.
Definition: scheduler.h:335
Definition: thread.h:812
This union represents a chain control block.
Definition: chain.h:96