source: rtems/cpukit/score/include/rtems/score/schedulersmp.h @ 6359b68

4.115
Last change on this file since 6359b68 was 6359b68, checked in by Sebastian Huber <sebastian.huber@…>, on 05/15/14 at 06:47:50

score: Add and use _Scheduler_SMP_Start_idle()

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief SMP Scheduler API
5 *
6 * @ingroup ScoreSchedulerSMP
7 */
8
9/*
10 * Copyright (c) 2013-2014 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef _RTEMS_SCORE_SCHEDULERSMP_H
24#define _RTEMS_SCORE_SCHEDULERSMP_H
25
26#include <rtems/score/chain.h>
27#include <rtems/score/scheduler.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
33/**
34 * @defgroup ScoreSchedulerSMP SMP Scheduler
35 *
36 * @ingroup ScoreScheduler
37 *
38 * @{
39 */
40
41/**
42 * @brief Scheduler context specialization for SMP schedulers.
43 */
44typedef struct {
45  /**
46   * @brief Basic scheduler context.
47   */
48  Scheduler_Context Base;
49
50  /**
51   * @brief The chain of scheduled nodes.
52   */
53  Chain_Control Scheduled;
54} Scheduler_SMP_Context;
55
56/**
57 * @brief SMP scheduler node states.
58 */
59typedef enum {
60  /**
61   * @brief This scheduler node is blocked.
62   *
63   * A scheduler node is blocked if the corresponding thread is not ready.
64   */
65  SCHEDULER_SMP_NODE_BLOCKED,
66
67  /**
68   * @brief The scheduler node is scheduled.
69   *
70   * A scheduler node is scheduled if the corresponding thread is ready and the
71   * scheduler allocated a processor for it.  A scheduled node is assigned to
72   * exactly one processor.  The count of scheduled nodes in this scheduler
73   * instance equals the processor count owned by the scheduler instance.
74   */
75  SCHEDULER_SMP_NODE_SCHEDULED,
76
77  /**
78   * @brief This scheduler node is ready.
79   *
80   * A scheduler node is ready if the corresponding thread is ready and the
81   * scheduler did not allocate a processor for it.
82   */
83  SCHEDULER_SMP_NODE_READY
84} Scheduler_SMP_Node_state;
85
86/**
87 * @brief Scheduler node specialization for SMP schedulers.
88 */
89typedef struct {
90  /**
91   * @brief Basic scheduler node.
92   */
93  Scheduler_Node Base;
94
95  /**
96   * @brief The state of this node.
97   */
98  Scheduler_SMP_Node_state state;
99} Scheduler_SMP_Node;
100
101void _Scheduler_SMP_Start_idle(
102  const Scheduler_Control *scheduler,
103  Thread_Control *thread,
104  Per_CPU_Control *cpu
105);
106
107/** @} */
108
109#ifdef __cplusplus
110}
111#endif /* __cplusplus */
112
113#endif /* _RTEMS_SCORE_SCHEDULERSMP_H */
Note: See TracBrowser for help on using the repository browser.