source: rtems/cpukit/include/rtems/rtems/tasksimpl.h @ 2afb22b

5
Last change on this file since 2afb22b 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.0 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicTasksImpl
5 *
6 * @brief Classic Tasks Manager Implementation
7 */
8
9/*  COPYRIGHT (c) 1989-2014.
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_TASKSIMPL_H
18#define _RTEMS_RTEMS_TASKSIMPL_H
19
20#include <rtems/rtems/tasks.h>
21#include <rtems/score/objectimpl.h>
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/threadimpl.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 * @defgroup ClassicTasksImpl Classic Tasks Manager Implementation
31 *
32 * @ingroup ClassicTasks
33 *
34 * @{
35 */
36
37/**
38 *  The following instantiates the information control block used to
39 *  manage this class of objects.
40 */
41extern Thread_Information _RTEMS_tasks_Information;
42
43/**
44 *  @brief RTEMS User Task Initialization
45 *
46 *  This routine creates and starts all configured user
47 *  initialization threads.
48 */
49void _RTEMS_tasks_Initialize_user_tasks( void );
50
51RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate(void)
52{
53  _Objects_Allocator_lock();
54
55  _Thread_Kill_zombies();
56
57  return (Thread_Control *)
58    _Objects_Allocate_unprotected( &_RTEMS_tasks_Information.Objects );
59}
60
61/**
62 *  @brief Frees a task control block.
63 *
64 *  This routine frees a task control block to the
65 *  inactive chain of free task control blocks.
66 */
67RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
68  Thread_Control *the_task
69)
70{
71  _Objects_Free(
72    _Objects_Get_information_id( the_task->Object.id ),
73    &the_task->Object
74  );
75}
76
77/**
78 * @brief Converts the RTEMS API priority to the corresponding SuperCore
79 * priority and validates it.
80 *
81 * The RTEMS API system priority is accepted as valid.
82 *
83 * @param[in] scheduler The scheduler instance.
84 * @param[in] priority The RTEMS API priority to convert and validate.
85 * @param[out] valid Indicates if the RTEMS API priority is valid and a
86 *   corresponding SuperCore priority in the specified scheduler instance
87 *   exists.
88 *
89 * @return The corresponding SuperCore priority.
90 */
91RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_Priority_To_core(
92  const Scheduler_Control *scheduler,
93  rtems_task_priority      priority,
94  bool                    *valid
95)
96{
97  *valid = ( priority <= scheduler->maximum_priority );
98
99  return _Scheduler_Map_priority( scheduler, (Priority_Control) priority );
100}
101
102/**
103 * @brief Converts the SuperCore priority to the corresponding RTEMS API
104 * priority.
105 *
106 * @param[in] scheduler The scheduler instance.
107 * @param[in] priority The SuperCore priority to convert.
108 *
109 * @return The corresponding RTEMS API priority.
110 */
111RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(
112  const Scheduler_Control *scheduler,
113  Priority_Control         priority
114)
115{
116  return (rtems_task_priority)
117    _Scheduler_Unmap_priority( scheduler, priority );
118}
119
120/**@}*/
121
122#if defined(RTEMS_MULTIPROCESSING)
123#include <rtems/rtems/taskmp.h>
124#endif
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif
131/* end of include file */
Note: See TracBrowser for help on using the repository browser.