source: rtems/cpukit/include/rtems/score/status.h @ d8de6b9

5
Last change on this file since d8de6b9 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.9 KB
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef _RTEMS_SCORE_STATUS_H
16#define _RTEMS_SCORE_STATUS_H
17
18#include <rtems/score/basedefs.h>
19
20#include <errno.h>
21#include <pthread.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27/**
28 * @brief Status code parts for the Classic API.
29 *
30 * Must be in synchronization with rtems_status_code.
31 */
32typedef enum {
33  STATUS_CLASSIC_INCORRECT_STATE = 14,
34  STATUS_CLASSIC_INTERNAL_ERROR = 13,
35  STATUS_CLASSIC_INVALID_NUMBER = 10,
36  STATUS_CLASSIC_INVALID_PRIORITY = 19,
37  STATUS_CLASSIC_INVALID_SIZE = 8,
38  STATUS_CLASSIC_NO_MEMORY = 26,
39  STATUS_CLASSIC_NOT_DEFINED = 11,
40  STATUS_CLASSIC_NOT_OWNER_OF_RESOURCE = 23,
41  STATUS_CLASSIC_OBJECT_WAS_DELETED = 7,
42  STATUS_CLASSIC_RESOURCE_IN_USE = 12,
43  STATUS_CLASSIC_SUCCESSFUL = 0,
44  STATUS_CLASSIC_TIMEOUT = 6,
45  STATUS_CLASSIC_TOO_MANY = 5,
46  STATUS_CLASSIC_UNSATISFIED = 13
47} Status_Classic;
48
49/**
50 * @brief Macro to build a status code from Classic and POSIX API parts.
51 */
52#define STATUS_BUILD( classic_status, posix_status ) \
53  ( ( ( (unsigned int) ( posix_status ) ) << 8 ) | ( classic_status ) )
54
55/**
56 * @brief Macro to get the Classic API status code.
57 */
58#define STATUS_GET_CLASSIC( status ) \
59  ( ( status ) & 0xff )
60
61/**
62 * @brief Macro to get the POSIX API status code.
63 *
64 * Performs an arithmetic shift to reconstruct a negative POSIX status.
65 */
66#define STATUS_GET_POSIX( status ) \
67  ( ( ( (int) ( status ) ) | 0xff ) >> 8 )
68
69/**
70 * @brief Status codes.
71 */
72typedef enum {
73  STATUS_BARRIER_AUTOMATICALLY_RELEASED =
74    STATUS_BUILD( STATUS_CLASSIC_SUCCESSFUL, PTHREAD_BARRIER_SERIAL_THREAD ),
75  STATUS_DEADLOCK =
76    STATUS_BUILD( STATUS_CLASSIC_INCORRECT_STATE, EDEADLK ),
77  STATUS_FLUSHED =
78    STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EAGAIN ),
79  STATUS_INCORRECT_STATE =
80    STATUS_BUILD( STATUS_CLASSIC_INCORRECT_STATE, EINVAL ),
81  STATUS_INTERRUPTED =
82    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EINTR ),
83  STATUS_INVALID_NUMBER =
84    STATUS_BUILD( STATUS_CLASSIC_INVALID_NUMBER, EINVAL ),
85  STATUS_INVALID_PRIORITY =
86    STATUS_BUILD( STATUS_CLASSIC_INVALID_PRIORITY, EINVAL ),
87  STATUS_MAXIMUM_COUNT_EXCEEDED =
88    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EOVERFLOW ),
89  STATUS_MESSAGE_INVALID_SIZE =
90    STATUS_BUILD( STATUS_CLASSIC_INVALID_SIZE, EMSGSIZE ),
91  STATUS_MESSAGE_QUEUE_WAIT_IN_ISR =
92    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, ENOMEM ),
93  STATUS_MESSAGE_QUEUE_WAS_DELETED =
94    STATUS_BUILD( STATUS_CLASSIC_OBJECT_WAS_DELETED, EBADF ),
95  STATUS_MINUS_ONE =
96    -1,
97  STATUS_MUTEX_CEILING_VIOLATED =
98    STATUS_BUILD( STATUS_CLASSIC_INVALID_PRIORITY, EINVAL ),
99  STATUS_NESTING_NOT_ALLOWED =
100    STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EDEADLK ),
101  STATUS_NO_MEMORY =
102    STATUS_BUILD( STATUS_CLASSIC_NO_MEMORY, EINVAL ),
103  STATUS_NOT_DEFINED =
104    STATUS_BUILD( STATUS_CLASSIC_NOT_DEFINED, EINVAL ),
105  STATUS_NOT_OWNER =
106    STATUS_BUILD( STATUS_CLASSIC_NOT_OWNER_OF_RESOURCE, EPERM ),
107  STATUS_OBJECT_WAS_DELETED =
108    STATUS_BUILD( STATUS_CLASSIC_OBJECT_WAS_DELETED, EINVAL ),
109  STATUS_RESOURCE_IN_USE =
110    STATUS_BUILD( STATUS_CLASSIC_RESOURCE_IN_USE, EBUSY ),
111  STATUS_RESULT_TOO_LARGE =
112    STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, ERANGE ),
113  STATUS_SUCCESSFUL =
114    STATUS_BUILD( STATUS_CLASSIC_SUCCESSFUL, 0 ),
115  STATUS_TIMEOUT =
116    STATUS_BUILD( STATUS_CLASSIC_TIMEOUT, ETIMEDOUT ),
117  STATUS_TOO_MANY =
118    STATUS_BUILD( STATUS_CLASSIC_TOO_MANY, EAGAIN ),
119  STATUS_UNAVAILABLE =
120    STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EBUSY ),
121  STATUS_UNSATISFIED =
122    STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EAGAIN )
123} Status_Control;
124
125#ifdef __cplusplus
126}
127#endif /* __cplusplus */
128
129#endif /* _RTEMS_SCORE_STATUS_H */
Note: See TracBrowser for help on using the repository browser.