source: rtems/cpukit/include/rtems/rtems/part.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.9 KB
Line 
1/**
2 * @file rtems/rtems/part.h
3 *
4 * @defgroup ClassicPart Partitions
5 *
6 * @ingroup ClassicRTEMS
7 * @brief Partition Manager
8 *
9 * This include file contains all the constants and structures associated
10 * with the Partition Manager. This manager provides facilities to
11 * dynamically allocate memory in fixed-sized units which are returned
12 * as buffers.
13 *
14 * Directives provided are:
15 *
16 * - create a partition
17 * - get an ID of a partition
18 * - delete a partition
19 * - get a buffer from a partition
20 * - return a buffer to a partition
21 */
22
23/* COPYRIGHT (c) 1989-2008.
24 * On-Line Applications Research Corporation (OAR).
25 *
26 * The license and distribution terms for this file may be
27 * found in the file LICENSE in this distribution or at
28 * http://www.rtems.org/license/LICENSE.
29 */
30
31#ifndef _RTEMS_RTEMS_PART_H
32#define _RTEMS_RTEMS_PART_H
33
34#include <rtems/rtems/attr.h>
35#include <rtems/rtems/status.h>
36#include <rtems/rtems/types.h>
37#include <rtems/score/isrlock.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/**
44 *  @defgroup ClassicPart Partitions
45 *
46 *  @ingroup ClassicRTEMS
47 *
48 *  This encapsulates functionality related to the
49 *  Classic API Partition Manager.
50 */
51/**@{*/
52
53/**
54 *  The following defines the control block used to manage each partition.
55 */
56typedef struct {
57  /** This field is the object management portion of a Partition instance. */
58  Objects_Control     Object;
59  /** This field is the lock of the Partition. */
60  ISR_LOCK_MEMBER(    Lock )
61  /** This field is the physical starting address of the Partition. */
62  void               *starting_address;
63  /** This field is the size of the Partition in bytes. */
64  intptr_t            length;
65  /** This field is the size of each buffer in bytes */
66  uint32_t            buffer_size;
67  /** This field is the attribute set provided at create time. */
68  rtems_attribute     attribute_set;
69  /** This field is the of allocated buffers. */
70  uint32_t            number_of_used_blocks;
71  /** This field is the chain used to manage unallocated buffers. */
72  Chain_Control       Memory;
73}   Partition_Control;
74
75/**
76 *  @brief RTEMS Partition Create
77 *
78 *  Partition Manager
79 *
80 *  This routine implements the rtems_partition_create directive.  The
81 *  partition will have the name name.  The memory area managed by
82 *  the partition is of length bytes and starts at starting_address.
83 *  The memory area will be divided into as many buffers of
84 *  buffer_size bytes as possible.   The attribute_set determines if
85 *  the partition is global or local.  It returns the id of the
86 *  created partition in ID.
87 */
88rtems_status_code rtems_partition_create(
89  rtems_name       name,
90  void            *starting_address,
91  uint32_t         length,
92  uint32_t         buffer_size,
93  rtems_attribute  attribute_set,
94  rtems_id        *id
95);
96
97/**
98 * @brief RTEMS Partition Ident
99 *
100 * This routine implements the rtems_partition_ident directive.
101 * This directive returns the partition ID associated with name.
102 * If more than one partition is named name, then the partition
103 * to which the ID belongs is arbitrary. node indicates the
104 * extent of the search for the ID of the partition named name.
105 * The search can be limited to a particular node or allowed to
106 * encompass all nodes.
107 *
108 * @param[in] name is the user defined partition name
109 * @param[in] node is(are) the node(s) to be searched
110 * @param[in] id is the pointer to partition id
111 *
112 * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful and
113 *              *id filled in with the partition id
114 */
115rtems_status_code rtems_partition_ident(
116  rtems_name  name,
117  uint32_t    node,
118  rtems_id   *id
119);
120
121/**
122 * @brief RTEMS Delete Partition
123 *
124 * This routine implements the rtems_partition_delete directive. The
125 * partition indicated by ID is deleted, provided that none of its buffers
126 * are still allocated.
127 *
128 * @param[in] id is the partition id
129 *
130 * @retval This method returns RTEMS_SUCCESSFUL if there was not an
131 *         error. Otherwise, a status code is returned indicating the
132 *         source of the error.
133 */
134rtems_status_code rtems_partition_delete(
135  rtems_id id
136);
137
138/**
139 * @brief RTEMS Get Partition Buffer
140 *
141 * This routine implements the rtems_partition_get_buffer directive. It
142 * attempts to allocate a buffer from the partition associated with ID.
143 * If a buffer is allocated, its address is returned in buffer.
144 *
145 * @param[in] id is the partition id
146 * @param[out] buffer is the pointer to buffer address
147 *
148 * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful
149 */
150rtems_status_code rtems_partition_get_buffer(
151  rtems_id   id,
152  void     **buffer
153);
154
155/**
156 *  @brief rtems_partition_return_buffer
157 *
158 *  This routine implements the rtems_partition_return_buffer directive.  It
159 *  frees the buffer to the partition associated with ID.  The buffer must
160 *  have been previously allocated from the same partition.
161 */
162rtems_status_code rtems_partition_return_buffer(
163  rtems_id  id,
164  void     *buffer
165);
166
167/**@}*/
168
169#ifdef __cplusplus
170}
171#endif
172
173#endif
174/* end of include file */
Note: See TracBrowser for help on using the repository browser.