source: rtems/cpukit/include/rtems/score/corebarrierimpl.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: 4.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Inlined Routines Associated with the SuperCore Barrier
5 *
6 * This include file contains all of the inlined routines associated
7 * with the SuperCore barrier.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2006.
12 *  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_COREBARRIERIMPL_H
20#define _RTEMS_SCORE_COREBARRIERIMPL_H
21
22#include <rtems/score/corebarrier.h>
23#include <rtems/score/status.h>
24#include <rtems/score/threadqimpl.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/**
31 * @addtogroup ScoreBarrier
32 */
33/**@{**/
34
35#define CORE_BARRIER_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
36
37/**
38 *  @brief Initialize core barrier.
39 *
40 *  This routine initializes the barrier based on the parameters passed.
41 *
42 *  @param[in] the_barrier is the barrier to initialize
43 *  @param[in] the_barrier_attributes define the behavior of this instance
44 */
45void _CORE_barrier_Initialize(
46  CORE_barrier_Control       *the_barrier,
47  CORE_barrier_Attributes    *the_barrier_attributes
48);
49
50RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
51  CORE_barrier_Control *the_barrier
52)
53{
54  _Thread_queue_Destroy( &the_barrier->Wait_queue );
55}
56
57RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(
58  CORE_barrier_Control *the_barrier,
59  Thread_queue_Context *queue_context
60)
61{
62  _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
63}
64
65RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(
66  CORE_barrier_Control *the_barrier,
67  Thread_queue_Context *queue_context
68)
69{
70  _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
71}
72
73/**
74 *  @brief Wait for the barrier.
75 *
76 *  This routine wait for the barrier to be released.  If the barrier
77 *  is set to automatic and this is the appropriate thread, then it returns
78 *  immediately.  Otherwise, the calling thread is blocked until the barrier
79 *  is released.
80 *
81 *  @param[in] the_barrier is the barrier to wait for
82 *  @param[in,out] executing The currently executing thread.
83 *  @param[in] wait is true if the calling thread is willing to wait
84 *
85 * @return The method status.
86 */
87Status_Control _CORE_barrier_Seize(
88  CORE_barrier_Control *the_barrier,
89  Thread_Control       *executing,
90  bool                  wait,
91  Thread_queue_Context *queue_context
92);
93
94uint32_t _CORE_barrier_Do_flush(
95  CORE_barrier_Control      *the_barrier,
96  Thread_queue_Flush_filter  filter,
97  Thread_queue_Context      *queue_context
98);
99
100/**
101 *  @brief Manually release the barrier.
102 *
103 *  This routine manually releases the barrier.  All of the threads waiting
104 *  for the barrier will be readied.
105 *
106 *  @param[in] the_barrier is the barrier to surrender
107 *  @param[in] mp_callout is the routine to invoke if the
108 *         thread unblocked is remote
109 *
110 *  @retval the number of unblocked threads
111 */
112RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
113  CORE_barrier_Control *the_barrier,
114  Thread_queue_Context *queue_context
115)
116{
117  return _CORE_barrier_Do_flush(
118    the_barrier,
119    _Thread_queue_Flush_default_filter,
120    queue_context
121  );
122}
123
124RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
125  CORE_barrier_Control *the_barrier,
126  Thread_queue_Context *queue_context
127)
128{
129  _CORE_barrier_Do_flush(
130    the_barrier,
131    _Thread_queue_Flush_status_object_was_deleted,
132    queue_context
133  );
134}
135
136/**
137 * This function returns true if the automatic release attribute is
138 * enabled in the @a attribute_set and false otherwise.
139 *
140 * @param[in] the_attribute is the attribute set to test
141 *
142 * @return true if the priority attribute is enabled
143 */
144RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(
145  CORE_barrier_Attributes *the_attribute
146)
147{
148   return
149     (the_attribute->discipline == CORE_BARRIER_AUTOMATIC_RELEASE);
150}
151
152/**
153 * This routine returns the number of threads currently waiting at the barrier.
154 *
155 * @param[in] the_barrier is the barrier to obtain the number of blocked
156 *            threads for
157 * @return the current count of this barrier
158 */
159RTEMS_INLINE_ROUTINE uint32_t  _CORE_barrier_Get_number_of_waiting_threads(
160  CORE_barrier_Control  *the_barrier
161)
162{
163  return the_barrier->number_of_waiting_threads;
164}
165
166/** @} */
167
168#ifdef __cplusplus
169}
170#endif
171
172#endif
173/* end of include file */
Note: See TracBrowser for help on using the repository browser.