source: rtems/cpukit/include/rtems/score/schedulernodeimpl.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: 3.2 KB
Line 
1/*
2 * Copyright (c) 2014, 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef _RTEMS_SCORE_SCHEDULERNODEIMPL_H
16#define _RTEMS_SCORE_SCHEDULERNODEIMPL_H
17
18#include <rtems/score/schedulernode.h>
19#include <rtems/score/priorityimpl.h>
20
21struct _Scheduler_Control;
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27#define SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE( node ) \
28  RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority.Node.Node.Chain )
29
30#define SCHEDULER_NODE_OF_WAIT_PRIORITY( node ) \
31  RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority )
32
33/**
34 * @brief Priority append indicator for the priority control used for the
35 * scheduler node priority.
36 */
37#define SCHEDULER_PRIORITY_APPEND_FLAG 1
38
39RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
40  const struct _Scheduler_Control *scheduler,
41  Scheduler_Node                  *node,
42  Thread_Control                  *the_thread,
43  Priority_Control                 priority
44)
45{
46  node->owner = the_thread;
47
48  node->Priority.value = priority;
49
50#if defined(RTEMS_SMP)
51  _Chain_Initialize_node( &node->Thread.Wait_node );
52  node->Wait.Priority.scheduler = scheduler;
53  node->user = the_thread;
54  node->idle = NULL;
55  _SMP_sequence_lock_Initialize( &node->Priority.Lock );
56#else
57  (void) scheduler;
58  (void) the_thread;
59#endif
60}
61
62RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
63  const Scheduler_Node *node
64)
65{
66  return _Priority_Get_scheduler( &node->Wait.Priority );
67}
68
69RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
70  const Scheduler_Node *node
71)
72{
73  return node->owner;
74}
75
76RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
77  Scheduler_Node *node
78)
79{
80  Priority_Control priority;
81
82#if defined(RTEMS_SMP)
83  unsigned int     seq;
84
85  do {
86    seq = _SMP_sequence_lock_Read_begin( &node->Priority.Lock );
87#endif
88
89    priority = node->Priority.value;
90
91#if defined(RTEMS_SMP)
92  } while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );
93#endif
94
95  return priority;
96}
97
98RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
99  Scheduler_Node   *node,
100  Priority_Control  new_priority,
101  bool              prepend_it
102)
103{
104#if defined(RTEMS_SMP)
105  unsigned int seq;
106
107  seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );
108#endif
109
110  new_priority |= ( prepend_it ? 0 : SCHEDULER_PRIORITY_APPEND_FLAG );
111  node->Priority.value = new_priority;
112
113#if defined(RTEMS_SMP)
114  _SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );
115#endif
116}
117
118#if defined(RTEMS_SMP)
119RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
120  const Scheduler_Node *node
121)
122{
123  return node->user;
124}
125
126RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
127  Scheduler_Node *node,
128  Thread_Control *user
129)
130{
131  node->user = user;
132}
133
134RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
135  const Scheduler_Node *node
136)
137{
138  return node->idle;
139}
140#endif
141
142#ifdef __cplusplus
143}
144#endif /* __cplusplus */
145
146#endif /* _RTEMS_SCORE_SCHEDULERNODEIMPL_H */
Note: See TracBrowser for help on using the repository browser.