1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
/**
* @file
*
* @brief Simple SMP Scheduler API
*
* @ingroup ScoreSchedulerSMP
*/
/*
* Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
*
* Copyright (c) 2013 embedded brains GmbH.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
#define _RTEMS_SCORE_SCHEDULERSIMPLE_SMP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
#include <rtems/score/schedulersmp.h>
/**
* @defgroup ScoreSchedulerSMP Simple SMP Scheduler
*
* @ingroup ScoreScheduler
*
* The Simple SMP Scheduler allocates a processor for the processor count
* highest priority ready threads. The thread priority and position in the
* ready chain are the only information to determine the scheduling decision.
* Threads with an allocated processor are in the scheduled chain. After
* initialization the scheduled chain has exactly processor count nodes. Each
* processor has exactly one allocated thread after initialization. All
* enqueue and extract operations may exchange threads with the scheduled
* chain. One thread will be added and another will be removed. The scheduled
* and ready chain is ordered according to the thread priority order. The
* chain insert operations are O(count of ready threads), thus this scheduler
* is unsuitable for most real-time applications.
*
* The thread preempt mode will be ignored.
*
* @{
*/
/**
* @brief Entry points for the Simple SMP Scheduler.
*/
#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
{ \
_Scheduler_simple_smp_Initialize, \
_Scheduler_simple_smp_Schedule, \
_Scheduler_simple_smp_Yield, \
_Scheduler_simple_smp_Block, \
_Scheduler_simple_smp_Enqueue_priority_fifo, \
_Scheduler_default_Allocate, \
_Scheduler_default_Free, \
_Scheduler_default_Update, \
_Scheduler_simple_smp_Enqueue_priority_fifo, \
_Scheduler_simple_smp_Enqueue_priority_lifo, \
_Scheduler_simple_smp_Extract, \
_Scheduler_priority_Priority_compare, \
_Scheduler_default_Release_job, \
_Scheduler_default_Tick, \
_Scheduler_simple_smp_Start_idle, \
_Scheduler_default_Get_affinity, \
_Scheduler_default_Set_affinity \
}
void _Scheduler_simple_smp_Initialize( void );
void _Scheduler_simple_smp_Block(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Enqueue_priority_fifo(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Enqueue_priority_lifo(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Extract(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Yield(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Schedule(
Scheduler_Control *base,
Thread_Control *thread
);
void _Scheduler_simple_smp_Start_idle(
Scheduler_Control *base,
Thread_Control *thread,
Per_CPU_Control *cpu
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */
|