source: rtems/cpukit/include/rtems/score/wkspace.h @ 878487b0

5
Last change on this file since 878487b0 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.3 KB
Line 
1/**
2 *  @file rtems/score/wkspace.h
3 *
4 *  @brief Information Related to the RAM Workspace
5 *
6 *  This include file contains information related to the
7 *  RAM Workspace.  This Handler provides mechanisms which can be used to
8 *  define, initialize and manipulate the workspace.
9 */
10
11/*
12 *  COPYRIGHT (c) 1989-2009.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#ifndef _RTEMS_SCORE_WKSPACE_H
21#define _RTEMS_SCORE_WKSPACE_H
22
23#include <rtems/score/heap.h>
24#include <rtems/score/interr.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/**
31 *  @defgroup ScoreWorkspace Workspace Handler
32 *
33 *  @ingroup Score
34 *
35 *  This handler encapsulates functionality related to the management of
36 *  the RTEMS Executive Workspace.
37 */
38/**@{*/
39
40/**
41 *  @brief Executive workspace control.
42 *
43 *  This is the heap control structure used to manage the RTEMS Executive
44 *  Workspace.
45 */
46extern Heap_Control _Workspace_Area;
47
48/**
49 * @brief Initilize workspace handler.
50 *
51 *  This routine performs the initialization necessary for this handler.
52 */
53void _Workspace_Handler_initialization(
54  Heap_Area *areas,
55  size_t area_count,
56  Heap_Initialization_or_extend_handler extend
57);
58
59/**
60 * @brief Allocate memory from workspace.
61 *
62 *  This routine returns the address of a block of memory of size
63 *  bytes.  If a block of the appropriate size cannot be allocated
64 *  from the workspace, then NULL is returned.
65 *
66 *  @param size is the requested size
67 *
68 *  @retval a pointer to the requested memory or NULL.
69 */
70void *_Workspace_Allocate(
71  size_t   size
72);
73
74/**
75 * @brief Allocate aligned memory from workspace.
76 *
77 * @param[in] size The size of the requested memory.
78 * @param[in] alignment The alignment of the requested memory.
79 *
80 * @retval NULL Not enough resources.
81 * @retval other The memory area begin.
82 */
83void *_Workspace_Allocate_aligned( size_t size, size_t alignment );
84
85/**
86 * @brief Free memory to the workspace.
87 *
88 *  This function frees the specified block of memory.  If the block
89 *  belongs to the Workspace and can be successfully freed, then
90 *  true is returned.  Otherwise false is returned.
91 *
92 *  @param block is the memory to free
93 *
94 *  @note If @a block is equal to NULL, then the request is ignored.
95 *        This allows the caller to not worry about whether or not
96 *        a pointer is NULL.
97 */
98
99void _Workspace_Free(
100  void *block
101);
102
103/**
104 * @brief Workspace allocate or fail with fatal error.
105 *
106 *  This routine returns the address of a block of memory of @a size
107 *  bytes.  If a block of the appropriate size cannot be allocated
108 *  from the workspace, then the internal error handler is invoked.
109 *
110 *  @param[in] size is the desired number of bytes to allocate
111 *  @retval If successful, the starting address of the allocated memory
112 */
113void *_Workspace_Allocate_or_fatal_error(
114  size_t  size
115);
116
117/**
118 * @brief Duplicates string with memory from the workspace.
119 *
120 * @param[in] string is the pointer to a zero terminated string.
121 * @param[in] len is the length of the string (equal to strlen(string)).
122 *
123 * @retval NULL Not enough memory.
124 * @retval other Duplicated string.
125 */
126char *_Workspace_String_duplicate(
127  const char *string,
128  size_t len
129);
130
131/**@}*/
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif
138/* end of include file */
Note: See TracBrowser for help on using the repository browser.