source: rtems/cpukit/include/rtems/rtems/modesimpl.h @ 78bbe59

5
Last change on this file since 78bbe59 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.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicModesImpl
5 *
6 * @brief Classic Modes Implementation
7 */
8
9/*  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef _RTEMS_RTEMS_MODESIMPL_H
18#define _RTEMS_RTEMS_MODESIMPL_H
19
20#include <rtems/rtems/modes.h>
21#include <rtems/score/isrlevel.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 * @defgroup ClassicModesImpl Classic Modes Implementation
29 *
30 * @ingroup ClassicModes
31 *
32 * @{
33 */
34
35/**
36 *  @brief Checks if any of the mode flags in mask are set in mode_set.
37 *
38 *  This function returns TRUE if any of the mode flags in mask
39 *  are set in mode_set, and FALSE otherwise.
40 */
41RTEMS_INLINE_ROUTINE bool _Modes_Mask_changed (
42  Modes_Control mode_set,
43  Modes_Control masks
44)
45{
46   return ( mode_set & masks ) ? true : false;
47}
48
49/**
50 *  @brief Checks if mode_set says that Asynchronous Signal Processing is disabled.
51 *
52 *  This function returns TRUE if mode_set indicates that Asynchronous
53 *  Signal Processing is disabled, and FALSE otherwise.
54 */
55RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
56  Modes_Control mode_set
57)
58{
59   return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
60}
61
62/**
63 *  @brief Checks if mode_set indicates that preemption is enabled.
64 *
65 *  This function returns TRUE if mode_set indicates that preemption
66 *  is enabled, and FALSE otherwise.
67 */
68RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
69  Modes_Control mode_set
70)
71{
72   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
73}
74
75/**
76 *  @brief Checks if mode_set indicates that timeslicing is enabled.
77 *
78 *  This function returns TRUE if mode_set indicates that timeslicing
79 *  is enabled, and FALSE otherwise.
80 */
81RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
82  Modes_Control mode_set
83)
84{
85  return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
86}
87
88/**
89 *  @brief Gets the interrupt level portion of the mode_set.
90 *
91 *  This function returns the interrupt level portion of the mode_set.
92 */
93RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
94  Modes_Control mode_set
95)
96{
97  return ( mode_set & RTEMS_INTERRUPT_MASK );
98}
99
100/**
101 *  @brief Sets the current interrupt level to that specified in the mode_set.
102 *
103 *  This routine sets the current interrupt level to that specified
104 *  in the mode_set.
105 */
106RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
107  Modes_Control mode_set
108)
109{
110  _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
111}
112
113/**
114 *  @brief Changes the modes in old_mode_set indicated by
115 *  mask to the requested values in new_mode_set.
116 *
117 *  This routine changes the modes in old_mode_set indicated by
118 *  mask to the requested values in new_mode_set.  The resulting
119 *  mode set is returned in out_mode_set and the modes that changed
120 *  is returned in changed.
121 */
122RTEMS_INLINE_ROUTINE void _Modes_Change (
123  Modes_Control  old_mode_set,
124  Modes_Control  new_mode_set,
125  Modes_Control  mask,
126  Modes_Control *out_mode_set,
127  Modes_Control *changed
128)
129{
130  Modes_Control _out_mode;
131
132  _out_mode      =  old_mode_set;
133  _out_mode     &= ~mask;
134  _out_mode     |= new_mode_set & mask;
135  *changed       = _out_mode ^ old_mode_set;
136  *out_mode_set  = _out_mode;
137}
138
139#ifdef __cplusplus
140}
141#endif
142
143/**@}*/
144
145#endif
146/* end of include file */
Note: See TracBrowser for help on using the repository browser.