source: rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h @ 0e754fac

5
Last change on this file since 0e754fac was 0e754fac, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 21, 2016 at 12:41:19 PM

score: Delete unused scheduler ask for help X op

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief Simple SMP Scheduler API
5 *
6 * @ingroup ScoreSchedulerSMPSimple
7 */
8
9/*
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  Copyright (c) 2013, 2016 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
30/**
31 * @defgroup ScoreSchedulerSMPSimple Simple Priority SMP Scheduler
32 *
33 * @ingroup ScoreSchedulerSMP
34 *
35 * The Simple Priority SMP Scheduler allocates a processor for the processor
36 * count highest priority ready threads.  The thread priority and position in
37 * the ready chain are the only information to determine the scheduling
38 * decision.  Threads with an allocated processor are in the scheduled chain.
39 * After initialization the scheduled chain has exactly processor count nodes.
40 * Each processor has exactly one allocated thread after initialization.  All
41 * enqueue and extract operations may exchange threads with the scheduled
42 * chain.  One thread will be added and another will be removed.  The scheduled
43 * and ready chain is ordered according to the thread priority order.  The
44 * chain insert operations are O(count of ready threads), thus this scheduler
45 * is unsuitable for most real-time applications.
46 *
47 * The thread preempt mode will be ignored.
48 *
49 * @{
50 */
51
52typedef struct {
53  Scheduler_SMP_Context Base;
54  Chain_Control         Ready;
55} Scheduler_simple_SMP_Context;
56
57#define SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY 255
58
59/**
60 * @brief Entry points for the Simple SMP Scheduler.
61 */
62#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
63  { \
64    _Scheduler_simple_SMP_Initialize, \
65    _Scheduler_default_Schedule, \
66    _Scheduler_simple_SMP_Yield, \
67    _Scheduler_simple_SMP_Block, \
68    _Scheduler_simple_SMP_Unblock, \
69    _Scheduler_simple_SMP_Update_priority, \
70    _Scheduler_default_Map_priority, \
71    _Scheduler_default_Unmap_priority, \
72    _Scheduler_simple_SMP_Ask_for_help, \
73    _Scheduler_simple_SMP_Reconsider_help_request, \
74    _Scheduler_simple_SMP_Withdraw_node, \
75    _Scheduler_simple_SMP_Node_initialize, \
76    _Scheduler_default_Node_destroy, \
77    _Scheduler_default_Release_job, \
78    _Scheduler_default_Cancel_job, \
79    _Scheduler_default_Tick, \
80    _Scheduler_SMP_Start_idle \
81    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
82  }
83
84void _Scheduler_simple_SMP_Initialize( const Scheduler_Control *scheduler );
85
86void _Scheduler_simple_SMP_Node_initialize(
87  const Scheduler_Control *scheduler,
88  Scheduler_Node          *node,
89  Thread_Control          *the_thread,
90  Priority_Control         priority
91);
92
93void _Scheduler_simple_SMP_Block(
94  const Scheduler_Control *scheduler,
95  Thread_Control          *thread,
96  Scheduler_Node          *node
97);
98
99Thread_Control *_Scheduler_simple_SMP_Unblock(
100  const Scheduler_Control *scheduler,
101  Thread_Control          *thread,
102  Scheduler_Node          *node
103);
104
105void _Scheduler_simple_SMP_Update_priority(
106  const Scheduler_Control *scheduler,
107  Thread_Control          *the_thread,
108  Scheduler_Node          *node
109);
110
111bool _Scheduler_simple_SMP_Ask_for_help(
112  const Scheduler_Control *scheduler,
113  Thread_Control          *the_thread,
114  Scheduler_Node          *node
115);
116
117void _Scheduler_simple_SMP_Reconsider_help_request(
118  const Scheduler_Control *scheduler,
119  Thread_Control          *the_thread,
120  Scheduler_Node          *node
121);
122
123void _Scheduler_simple_SMP_Withdraw_node(
124  const Scheduler_Control *scheduler,
125  Thread_Control          *the_thread,
126  Scheduler_Node          *node,
127  Thread_Scheduler_state   next_state
128);
129
130Thread_Control *_Scheduler_simple_SMP_Yield(
131  const Scheduler_Control *scheduler,
132  Thread_Control          *thread,
133  Scheduler_Node          *node
134);
135
136/** @} */
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
143/* end of include file */
Note: See TracBrowser for help on using the repository browser.