source: rtems/cpukit/include/rtems/score/scheduleredf.h @ 21275b58

5
Last change on this file since 21275b58 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 5.2 KB
Line 
1/**
2 *  @file  rtems/score/scheduleredf.h
3 *
4 *  @brief Data Related to the Manipulation of Threads for the EDF Scheduler
5 *
6 *  This include file contains all the constants and structures associated
7 *  with the manipulation of threads for the EDF scheduler.
8 */
9
10/*
11 *  Copryight (c) 2011 Petr Benes.
12 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
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_SCHEDULEREDF_H
20#define _RTEMS_SCORE_SCHEDULEREDF_H
21
22#include <rtems/score/priority.h>
23#include <rtems/score/scheduler.h>
24#include <rtems/score/schedulerpriority.h>
25#include <rtems/score/rbtree.h>
26
27#include <limits.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/**
34 *  @defgroup ScoreSchedulerEDF EDF Scheduler
35 *
36 *  @ingroup ScoreScheduler
37 */
38/**@{*/
39
40/*
41 * Actually the EDF scheduler supports a maximum priority of
42 * 0x7fffffffffffffff, but the user API is limited to uint32_t or int for
43 * thread priorities.  Ignore ILP64 targets for now.
44 */
45#define SCHEDULER_EDF_MAXIMUM_PRIORITY INT_MAX
46
47/**
48 *  Entry points for the Earliest Deadline First Scheduler.
49 */
50#define SCHEDULER_EDF_ENTRY_POINTS \
51  { \
52    _Scheduler_EDF_Initialize,       /* initialize entry point */ \
53    _Scheduler_EDF_Schedule,         /* schedule entry point */ \
54    _Scheduler_EDF_Yield,            /* yield entry point */ \
55    _Scheduler_EDF_Block,            /* block entry point */ \
56    _Scheduler_EDF_Unblock,          /* unblock entry point */ \
57    _Scheduler_EDF_Update_priority,  /* update priority entry point */ \
58    _Scheduler_EDF_Map_priority,     /* map priority entry point */ \
59    _Scheduler_EDF_Unmap_priority,   /* unmap priority entry point */ \
60    SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
61    _Scheduler_EDF_Node_initialize,  /* node initialize entry point */ \
62    _Scheduler_default_Node_destroy, /* node destroy entry point */ \
63    _Scheduler_EDF_Release_job,      /* new period of task */ \
64    _Scheduler_EDF_Cancel_job,       /* cancel period of task */ \
65    _Scheduler_default_Tick,         /* tick entry point */ \
66    _Scheduler_default_Start_idle    /* start idle entry point */ \
67    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
68  }
69
70typedef struct {
71  /**
72   * @brief Basic scheduler context.
73   */
74  Scheduler_Context Base;
75
76  /**
77   * Top of the ready queue.
78   */
79  RBTree_Control Ready;
80} Scheduler_EDF_Context;
81
82/**
83 * @brief Scheduler node specialization for EDF schedulers.
84 */
85typedef struct {
86  /**
87   * @brief Basic scheduler node.
88   */
89  Scheduler_Node Base;
90
91  /**
92   * Rbtree node related to this thread.
93   */
94  RBTree_Node Node;
95
96  /**
97   * @brief The thread priority currently used for this scheduler instance.
98   */
99  Priority_Control priority;
100} Scheduler_EDF_Node;
101
102/**
103 *  @brief Initialize EDF scheduler.
104 *
105 *  This routine initializes the EDF scheduler.
106 *
107 *  @param[in] scheduler The scheduler instance.
108 */
109void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler );
110
111void _Scheduler_EDF_Block(
112  const Scheduler_Control *scheduler,
113  Thread_Control          *the_thread,
114  Scheduler_Node          *node
115);
116
117/**
118 *  @brief Sets the heir thread to be the next ready thread
119 *  in the rbtree ready queue.
120 *
121 *  This kernel routine sets the heir thread to be the next ready thread
122 *  in the rbtree ready queue.
123 *
124 *  @param[in] scheduler The scheduler instance.
125 *  @param[in] the_thread being scheduled.
126 */
127void _Scheduler_EDF_Schedule(
128  const Scheduler_Control *scheduler,
129  Thread_Control          *the_thread
130);
131
132/**
133 *  @brief Initializes an EDF specific scheduler node of @a the_thread.
134 *
135 *  @param[in] scheduler The scheduler instance.
136 *  @param[in] node being initialized.
137 *  @param[in] the_thread the thread of the node.
138 *  @param[in] priority The thread priority.
139 */
140void _Scheduler_EDF_Node_initialize(
141  const Scheduler_Control *scheduler,
142  Scheduler_Node          *node,
143  Thread_Control          *the_thread,
144  Priority_Control         priority
145);
146
147void _Scheduler_EDF_Unblock(
148  const Scheduler_Control *scheduler,
149  Thread_Control          *the_thread,
150  Scheduler_Node          *node
151);
152
153void _Scheduler_EDF_Update_priority(
154  const Scheduler_Control *scheduler,
155  Thread_Control          *the_thread,
156  Scheduler_Node          *node
157);
158
159Priority_Control _Scheduler_EDF_Map_priority(
160  const Scheduler_Control *scheduler,
161  Priority_Control         priority
162);
163
164Priority_Control _Scheduler_EDF_Unmap_priority(
165  const Scheduler_Control *scheduler,
166  Priority_Control         priority
167);
168
169void _Scheduler_EDF_Yield(
170  const Scheduler_Control *scheduler,
171  Thread_Control          *the_thread,
172  Scheduler_Node          *node
173);
174
175void _Scheduler_EDF_Release_job(
176  const Scheduler_Control *scheduler,
177  Thread_Control          *the_thread,
178  Priority_Node           *priority_node,
179  uint64_t                 deadline,
180  Thread_queue_Context    *queue_context
181);
182
183void _Scheduler_EDF_Cancel_job(
184  const Scheduler_Control *scheduler,
185  Thread_Control          *the_thread,
186  Priority_Node           *priority_node,
187  Thread_queue_Context    *queue_context
188);
189
190#ifdef __cplusplus
191}
192#endif
193
194/**@}*/
195
196#endif
197/* end of include file */
Note: See TracBrowser for help on using the repository browser.