source: rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h @ a936aa49

4.11
Last change on this file since a936aa49 was a936aa49, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 6, 2013 at 1:41:00 PM

scheduler: New simple SMP scheduler implementation

The new 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.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**
2 * @file
3 *
4 * @brief Simple SMP Scheduler API
5 *
6 * @ingroup ScoreSchedulerSMP
7 */
8
9/*
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  Copyright (c) 2013 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.com/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/schedulersimple.h>
28#include <rtems/score/schedulerpriority.h>
29
30/**
31 * @defgroup ScoreSchedulerSMP Simple SMP Scheduler
32 *
33 * @ingroup ScoreScheduler
34 *
35 * The Simple SMP Scheduler allocates a processor for the processor count
36 * highest priority ready threads.  The thread priority and position in the
37 * ready chain are the only information to determine the scheduling decision.
38 * Threads with an allocated processor are in the scheduled chain.  After
39 * initialization the scheduled chain has exactly processor count nodes.  Each
40 * 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  Chain_Control ready;
54  Chain_Control scheduled;
55} Scheduler_simple_smp_Control;
56
57/**
58 * @brief Entry points for the Simple SMP Scheduler.
59 */
60#define SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
61  { \
62    _Scheduler_simple_smp_Initialize, \
63    _Scheduler_simple_smp_Schedule, \
64    _Scheduler_simple_smp_Yield, \
65    _Scheduler_simple_smp_Extract, \
66    _Scheduler_simple_smp_Enqueue_priority_fifo, \
67    _Scheduler_simple_Allocate, \
68    _Scheduler_simple_Free, \
69    _Scheduler_simple_Update, \
70    _Scheduler_simple_smp_Enqueue_priority_fifo, \
71    _Scheduler_simple_smp_Enqueue_priority_lifo, \
72    _Scheduler_simple_smp_Extract, \
73    _Scheduler_priority_Priority_compare, \
74    _Scheduler_priority_Release_job, \
75    _Scheduler_default_Tick, \
76    _Scheduler_simple_smp_Start_idle \
77  }
78
79void _Scheduler_simple_smp_Initialize( void );
80
81void _Scheduler_simple_smp_Enqueue_priority_fifo( Thread_Control *thread );
82
83void _Scheduler_simple_smp_Enqueue_priority_lifo( Thread_Control *thread );
84
85void _Scheduler_simple_smp_Extract( Thread_Control *thread );
86
87void _Scheduler_simple_smp_Yield( Thread_Control *thread );
88
89void _Scheduler_simple_smp_Schedule( void );
90
91void _Scheduler_simple_smp_Start_idle(
92  Thread_Control *thread,
93  Per_CPU_Control *cpu
94);
95
96/** @} */
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif
103/* end of include file */
Note: See TracBrowser for help on using the repository browser.