source: rtems/cpukit/include/rtems/score/context.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: 4.5 KB
Line 
1/**
2 *  @file  rtems/score/context.h
3 *
4 *  @brief Information About Each Thread's Context
5 *
6 *  This include file contains all information about each thread's context.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2011.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_SCORE_CONTEXT_H
19#define _RTEMS_SCORE_CONTEXT_H
20
21/**
22 *  @defgroup ScoreContext Context Handler
23 *
24 *  @ingroup Score
25 *
26 *  This handler encapsulates functionality which abstracts thread context
27 *  management in a portable manner.
28 *
29 *  The context switch needed variable is contained in the per cpu
30 *  data structure.
31 */
32/**@{*/
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include <rtems/score/cpu.h>
39
40/**
41 *  @brief Size of floating point context area.
42 *
43 *  This constant defines the number of bytes required
44 *  to store a full floating point context.
45 */
46#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
47  #define CONTEXT_FP_SIZE CPU_CONTEXT_FP_SIZE
48#else
49  #define CONTEXT_FP_SIZE 0
50#endif
51
52/**
53 *  @brief Initialize context area.
54 *
55 *  This routine initializes @a _the_context such that the stack
56 *  pointer, interrupt level, and entry point are correct for the
57 *  thread's initial state.
58 *
59 *  @param[in] _the_context will be initialized
60 *  @param[in] _stack is the lowest physical address of the thread's
61 *         context
62 *  @param[in] _size is the size in octets of the thread's context
63 *  @param[in] _isr is the ISR enable level for this thread
64 *  @param[in] _entry is this thread's entry point
65 *  @param[in] _is_fp is set to true if this thread has floating point
66 *         enabled
67 *  @param[in] _tls_area The thread-local storage (TLS) area begin.
68 */
69#define _Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
70  _is_fp, _tls_area ) \
71    _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
72      _is_fp, _tls_area )
73
74/**
75 *  This macro is invoked from _Thread_Handler to do whatever CPU
76 *  specific magic is required that must be done in the context of
77 *  the thread when it starts.
78 *
79 *  If the CPU architecture does not require any magic, then this
80 *  macro is empty.
81 */
82
83#if defined(_CPU_Context_Initialization_at_thread_begin)
84  #define _Context_Initialization_at_thread_begin() \
85     _CPU_Context_Initialization_at_thread_begin()
86#else
87  #define _Context_Initialization_at_thread_begin()
88#endif
89
90/**
91 *  @brief Perform context switch.
92 *
93 *  This routine saves the current context into the @a _executing
94 *  context record and restores the context specified by @a _heir.
95 *
96 *  @param[in] _executing is the currently executing thread's context
97 *  @param[in] _heir is the context of the thread to be switched to
98 */
99#define _Context_Switch( _executing, _heir ) \
100   _CPU_Context_switch( _executing, _heir )
101
102/**
103 *  @brief Restart currently executing thread.
104 *
105 *  This routine restarts the calling thread by restoring its initial
106 *  stack pointer and returning to the thread's entry point.
107 *
108 *  @param[in] _the_context is the context of the thread to restart
109 */
110#define _Context_Restart_self( _the_context ) \
111   _CPU_Context_Restart_self( _the_context )
112
113/**
114 *  @brief Initialize floating point context area.
115 *
116 *  This routine initializes the floating point context save
117 *  area to contain an initial known state.
118 *
119 *  @param[in] _fp_area is the base address of the floating point
120 *         context save area to initialize.
121 */
122#define _Context_Initialize_fp( _fp_area ) \
123   _CPU_Context_Initialize_fp( _fp_area )
124
125/**
126 *  @brief Restore floating point context area.
127 *
128 *  This routine restores the floating point context contained
129 *  in the @a _fp area.  It is assumed that the current
130 *  floating point context has been saved by a previous invocation
131 *  of @a _Context_Save_fp.
132 *
133 *  @param[in] _fp points to the floating point context area to restore.
134 */
135#define _Context_Restore_fp( _fp ) \
136   _CPU_Context_restore_fp( _fp )
137
138/**
139 *  @brief Save floating point context area.
140 *
141 *  This routine saves the current floating point context
142 *  in the @a _fp area.
143 *
144 *  @param[in] _fp points to the floating point context area to restore.
145 */
146#define _Context_Save_fp( _fp ) \
147   _CPU_Context_save_fp( _fp )
148
149#if defined(_CPU_Context_Destroy)
150  #define _Context_Destroy( _the_thread, _the_context ) \
151    _CPU_Context_Destroy( _the_thread, _the_context )
152#else
153  #define _Context_Destroy( _the_thread, _the_context )
154#endif
155
156#ifdef __cplusplus
157}
158#endif
159
160/**@}*/
161
162#endif
163/* end of include file */
Note: See TracBrowser for help on using the repository browser.