summaryrefslogtreecommitdiffstats
path: root/c/src/exec/rtems/headers/status.h
blob: 42b87547807aa54bde502d458c23a8fdb8c72fae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*  status.h
 *
 *  This include file contains the status codes returned from the
 *  executive directives.
 *
 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
 *  On-Line Applications Research Corporation (OAR).
 *  All rights assigned to U.S. Government, 1994.
 *
 *  This material may be reproduced by or for the U.S. Government pursuant
 *  to the copyright license under the clause at DFARS 252.227-7013.  This
 *  notice must appear in all copies of this file and its derivatives.
 *
 *  $Id$
 */

#ifndef __RTEMS_STATUS_h
#define __RTEMS_STATUS_h

#ifdef __cplusplus
extern "C" {
#endif

/* types */

/* enumerated constants */

typedef enum {
  RTEMS_SUCCESSFUL               =  0, /* successful completion */
  RTEMS_TASK_EXITTED             =  1, /* returned from a thread */
  RTEMS_MP_NOT_CONFIGURED        =  2, /* multiprocessing not configured */
  RTEMS_INVALID_NAME             =  3, /* invalid object name */
  RTEMS_INVALID_ID               =  4, /* invalid object id */
  RTEMS_TOO_MANY                 =  5, /* too many */
  RTEMS_TIMEOUT                  =  6, /* timed out waiting */
  RTEMS_OBJECT_WAS_DELETED       =  7, /* object deleted while waiting */
  RTEMS_INVALID_SIZE             =  8, /* specified size was invalid */
  RTEMS_INVALID_ADDRESS          =  9, /* address specified is invalid */
  RTEMS_INVALID_NUMBER           = 10, /* number was invalid */
  RTEMS_NOT_DEFINED              = 11, /* item has not been initialized */
  RTEMS_RESOURCE_IN_USE          = 12, /* resources still outstanding */
  RTEMS_UNSATISFIED              = 13, /* request not satisfied */
  RTEMS_INCORRECT_STATE          = 14, /* thread is in wrong state */
  RTEMS_ALREADY_SUSPENDED        = 15, /* thread already in state */
  RTEMS_ILLEGAL_ON_SELF          = 16, /* illegal on calling thread */
  RTEMS_ILLEGAL_ON_REMOTE_OBJECT = 17, /* illegal for remote object */
  RTEMS_CALLED_FROM_ISR          = 18, /* called from wrong environment */
  RTEMS_INVALID_PRIORITY         = 19, /* invalid thread priority */
  RTEMS_INVALID_CLOCK            = 20, /* invalid date/time */
  RTEMS_INVALID_NODE             = 21, /* invalid node id */
  RTEMS_NOT_CONFIGURED           = 22, /* directive not configured */
  RTEMS_NOT_OWNER_OF_RESOURCE    = 23, /* not owner of resource */
  RTEMS_NOT_IMPLEMENTED          = 24, /* directive not implemented */
  RTEMS_INTERNAL_ERROR           = 25, /* RTEMS inconsistency detected */
  RTEMS_PROXY_BLOCKING           = 26, /* internal multiprocessing only */
  RTEMS_NO_MEMORY                = 27  /* could not get enough memory */
} rtems_status_code;

#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
#define RTEMS_STATUS_CODES_LAST  RTEMS_NO_MEMORY

/*
 *  rtems_is_status_successful
 *
 *  DESCRIPTION:
 *
 *  This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
 *  and FALSE otherwise.
 */

STATIC INLINE boolean rtems_is_status_successful (
  rtems_status_code code
);

/*
 *  rtems_are_statuses_equal
 *
 *  DESCRIPTION:
 *
 *  This function returns TRUE if the status code1 is equal to code2,
 *  and FALSE otherwise.
 */

STATIC INLINE boolean rtems_are_statuses_equal (
  rtems_status_code code1,
  rtems_status_code code2
);

/*
 *  _Status_Is_proxy_blocking
 *
 *  DESCRIPTION:
 *
 *  This function returns TRUE if the status code is equal to the
 *  status which indicates that a proxy is blocking, and FALSE otherwise.
 */

STATIC INLINE boolean _Status_Is_proxy_blocking (
  rtems_status_code code
);

#include <rtems/status.inl>

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */