source: rtems/cpukit/include/rtems/score/coremutex.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: 2.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief CORE Mutex API
5 *
6 * This include file contains all the constants and structures associated with
7 * the Mutex Handler.  A mutex is an enhanced version of the standard Dijkstra
8 * binary semaphore used to provide synchronization and mutual exclusion
9 * capabilities.
10 */
11
12/*
13 *  COPYRIGHT (c) 1989-2011.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_SCORE_COREMUTEX_H
22#define _RTEMS_SCORE_COREMUTEX_H
23
24#include <rtems/score/thread.h>
25#include <rtems/score/threadq.h>
26#include <rtems/score/priority.h>
27#include <rtems/score/watchdog.h>
28#include <rtems/score/interr.h>
29
30struct _Scheduler_Control;
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/**
37 *  @defgroup ScoreMutex Mutex Handler
38 *
39 *  @ingroup Score
40 *
41 *  This handler encapsulates functionality which provides the foundation
42 *  Mutex services used in all of the APIs supported by RTEMS.
43 */
44/**@{*/
45
46/**
47 *  @brief Control block used to manage each mutex.
48 *
49 *  The following defines the control block used to manage each mutex.
50 */
51typedef struct {
52  /**
53   * @brief The thread queue of this mutex.
54   *
55   * The owner of the thread queue indicates the mutex owner.
56   */
57  Thread_queue_Control Wait_queue;
58} CORE_mutex_Control;
59
60/**
61 * @brief The recursive mutex control.
62 */
63typedef struct {
64  /**
65   * @brief The plain non-recursive mutex.
66   */
67  CORE_mutex_Control Mutex;
68
69  /**
70   * @brief The nest level in case of a recursive seize.
71   */
72  unsigned int nest_level;
73} CORE_recursive_mutex_Control;
74
75/**
76 * @brief The recursive mutex control with priority ceiling protocol support.
77 */
78typedef struct {
79  /**
80   * @brief The plain recursive mutex.
81   */
82  CORE_recursive_mutex_Control Recursive;
83
84  /**
85   * @brief The priority ceiling node for the mutex owner.
86   */
87  Priority_Node Priority_ceiling;
88
89#if defined(RTEMS_SMP)
90  /**
91   * @brief The scheduler instance for this priority ceiling mutex.
92   */
93  const struct _Scheduler_Control *scheduler;
94#endif
95} CORE_ceiling_mutex_Control;
96
97/**@}*/
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif
104/*  end of include file */
Note: See TracBrowser for help on using the repository browser.