source: rtems/cpukit/include/rtems/score/atomic.h @ 21275b58

Last change on this file since 21275b58 was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

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.6 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreAtomic
5 *
6 * @brief Atomic Operations API
7 */
8
9/*
10 * COPYRIGHT (c) 2012-2013 Deng Hengyi.
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_SCORE_ATOMIC_H
18#define _RTEMS_SCORE_ATOMIC_H
19
20#include <rtems/score/cpuatomic.h>
21
22/**
23 * @defgroup ScoreAtomic Atomic Operations
24 *
25 * @ingroup Score
26 *
27 * @brief Support for atomic operations.
28 *
29 * Atomic operations can be used to implement low-level synchronization
30 * primitives on SMP systems, like spin locks.  All atomic operations are
31 * defined in terms of C11 (ISO/IEC 9899:2011) or C++11 (ISO/IEC 14882:2011).
32 * For documentation use the standard documents.
33 *
34 * @{
35 */
36
37typedef CPU_atomic_Uint Atomic_Uint;
38
39typedef CPU_atomic_Ulong Atomic_Ulong;
40
41typedef CPU_atomic_Uintptr Atomic_Uintptr;
42
43typedef CPU_atomic_Flag Atomic_Flag;
44
45typedef CPU_atomic_Order Atomic_Order;
46
47#define ATOMIC_ORDER_RELAXED CPU_ATOMIC_ORDER_RELAXED
48
49#define ATOMIC_ORDER_ACQUIRE CPU_ATOMIC_ORDER_ACQUIRE
50
51#define ATOMIC_ORDER_RELEASE CPU_ATOMIC_ORDER_RELEASE
52
53#define ATOMIC_ORDER_ACQ_REL CPU_ATOMIC_ORDER_ACQ_REL
54
55#define ATOMIC_ORDER_SEQ_CST CPU_ATOMIC_ORDER_SEQ_CST
56
57#define ATOMIC_INITIALIZER_UINT( value ) CPU_ATOMIC_INITIALIZER_UINT( value )
58
59#define ATOMIC_INITIALIZER_ULONG( value ) CPU_ATOMIC_INITIALIZER_ULONG( value )
60
61#define ATOMIC_INITIALIZER_UINTPTR( value ) CPU_ATOMIC_INITIALIZER_UINTPTR( value )
62
63#define ATOMIC_INITIALIZER_FLAG CPU_ATOMIC_INITIALIZER_FLAG
64
65#define _Atomic_Fence( order ) _CPU_atomic_Fence( order )
66
67#define _Atomic_Init_uint( obj, desired ) \
68  _CPU_atomic_Init_uint( obj, desired )
69
70#define _Atomic_Init_ulong( obj, desired ) \
71  _CPU_atomic_Init_ulong( obj, desired )
72
73#define _Atomic_Init_uintptr( obj, desired ) \
74  _CPU_atomic_Init_uintptr( obj, desired )
75
76#define _Atomic_Load_uint( obj, order ) \
77  _CPU_atomic_Load_uint( obj, order )
78
79#define _Atomic_Load_ulong( obj, order ) \
80  _CPU_atomic_Load_ulong( obj, order )
81
82#define _Atomic_Load_uintptr( obj, order ) \
83  _CPU_atomic_Load_uintptr( obj, order )
84
85#define _Atomic_Store_uint( obj, desr, order ) \
86  _CPU_atomic_Store_uint( obj, desr, order )
87
88#define _Atomic_Store_ulong( obj, desr, order ) \
89  _CPU_atomic_Store_ulong( obj, desr, order )
90
91#define _Atomic_Store_uintptr( obj, desr, order ) \
92  _CPU_atomic_Store_uintptr( obj, desr, order )
93
94#define _Atomic_Fetch_add_uint( obj, arg, order ) \
95  _CPU_atomic_Fetch_add_uint( obj, arg, order )
96
97#define _Atomic_Fetch_add_ulong( obj, arg, order ) \
98  _CPU_atomic_Fetch_add_ulong( obj, arg, order )
99
100#define _Atomic_Fetch_add_uintptr( obj, arg, order ) \
101  _CPU_atomic_Fetch_add_uintptr( obj, arg, order )
102
103#define _Atomic_Fetch_sub_uint( obj, arg, order ) \
104  _CPU_atomic_Fetch_sub_uint( obj, arg, order )
105
106#define _Atomic_Fetch_sub_ulong( obj, arg, order ) \
107  _CPU_atomic_Fetch_sub_ulong( obj, arg, order )
108
109#define _Atomic_Fetch_sub_uintptr( obj, arg, order ) \
110  _CPU_atomic_Fetch_sub_uintptr( obj, arg, order )
111
112#define _Atomic_Fetch_or_uint( obj, arg, order ) \
113  _CPU_atomic_Fetch_or_uint( obj, arg, order )
114
115#define _Atomic_Fetch_or_ulong( obj, arg, order ) \
116  _CPU_atomic_Fetch_or_ulong( obj, arg, order )
117
118#define _Atomic_Fetch_or_uintptr( obj, arg, order ) \
119  _CPU_atomic_Fetch_or_uintptr( obj, arg, order )
120
121#define _Atomic_Fetch_and_uint( obj, arg, order ) \
122  _CPU_atomic_Fetch_and_uint( obj, arg, order )
123
124#define _Atomic_Fetch_and_ulong( obj, arg, order ) \
125  _CPU_atomic_Fetch_and_ulong( obj, arg, order )
126
127#define _Atomic_Fetch_and_uintptr( obj, arg, order ) \
128  _CPU_atomic_Fetch_and_uintptr( obj, arg, order )
129
130#define _Atomic_Exchange_uint( obj, desr, order ) \
131  _CPU_atomic_Exchange_uint( obj, desr, order )
132
133#define _Atomic_Exchange_ulong( obj, desr, order ) \
134  _CPU_atomic_Exchange_ulong( obj, desr, order )
135
136#define _Atomic_Exchange_uintptr( obj, desr, order ) \
137  _CPU_atomic_Exchange_uintptr( obj, desr, order )
138
139#define _Atomic_Compare_exchange_uint( obj, expected, desired, succ, fail ) \
140  _CPU_atomic_Compare_exchange_uint( obj, expected, desired, succ, fail )
141
142#define _Atomic_Compare_exchange_ulong( obj, expected, desired, succ, fail ) \
143  _CPU_atomic_Compare_exchange_ulong( obj, expected, desired, succ, fail )
144
145#define _Atomic_Compare_exchange_uintptr( obj, expected, desired, succ, fail ) \
146  _CPU_atomic_Compare_exchange_uintptr( obj, expected, desired, succ, fail )
147
148#define _Atomic_Flag_clear( obj, order ) \
149  _CPU_atomic_Flag_clear( obj, order )
150
151#define _Atomic_Flag_test_and_set( obj, order ) \
152  _CPU_atomic_Flag_test_and_set( obj, order )
153
154/** @} */
155
156#endif /* _RTEMS_SCORE_ATOMIC_H */
Note: See TracBrowser for help on using the repository browser.