RTEMS: cpukit/include/rtems/score/status.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
status.h
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
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_PROXY_BLOCKING = 29,
43 STATUS_CLASSIC_RESOURCE_IN_USE = 12,
44 STATUS_CLASSIC_SUCCESSFUL = 0,
45 STATUS_CLASSIC_TIMEOUT = 6,
46 STATUS_CLASSIC_TOO_MANY = 5,
47 STATUS_CLASSIC_UNSATISFIED = 13
48} Status_Classic;
49
55#define STATUS_BUILD( classic_status, posix_status ) \
56 ( ( ( posix_status ) * 256 ) | ( classic_status ) )
57
61#define STATUS_GET_CLASSIC( status ) \
62 ( ( status ) & 0xff )
63
69#define STATUS_GET_POSIX( status ) \
70 ( ( status ) / 256 )
71
75typedef enum {
76 STATUS_BARRIER_AUTOMATICALLY_RELEASED =
77 STATUS_BUILD( STATUS_CLASSIC_SUCCESSFUL, PTHREAD_BARRIER_SERIAL_THREAD ),
78 STATUS_DEADLOCK =
79 STATUS_BUILD( STATUS_CLASSIC_INCORRECT_STATE, EDEADLK ),
80 STATUS_FLUSHED =
81 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EAGAIN ),
82 STATUS_INCORRECT_STATE =
83 STATUS_BUILD( STATUS_CLASSIC_INCORRECT_STATE, EINVAL ),
84 STATUS_INTERRUPTED =
85 STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EINTR ),
86 STATUS_INVALID_NUMBER =
87 STATUS_BUILD( STATUS_CLASSIC_INVALID_NUMBER, EINVAL ),
88 STATUS_INVALID_PRIORITY =
89 STATUS_BUILD( STATUS_CLASSIC_INVALID_PRIORITY, EINVAL ),
90 STATUS_MAXIMUM_COUNT_EXCEEDED =
91 STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EOVERFLOW ),
92 STATUS_MESSAGE_INVALID_SIZE =
93 STATUS_BUILD( STATUS_CLASSIC_INVALID_SIZE, EMSGSIZE ),
94 STATUS_MESSAGE_QUEUE_WAIT_IN_ISR =
95 STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EAGAIN ),
96 STATUS_MESSAGE_QUEUE_WAS_DELETED =
97 STATUS_BUILD( STATUS_CLASSIC_OBJECT_WAS_DELETED, EBADF ),
98 STATUS_MINUS_ONE =
99 -1,
100 STATUS_MUTEX_CEILING_VIOLATED =
101 STATUS_BUILD( STATUS_CLASSIC_INVALID_PRIORITY, EINVAL ),
102 STATUS_NESTING_NOT_ALLOWED =
103 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EDEADLK ),
104 STATUS_NO_MEMORY =
105 STATUS_BUILD( STATUS_CLASSIC_NO_MEMORY, EINVAL ),
106 STATUS_NOT_DEFINED =
107 STATUS_BUILD( STATUS_CLASSIC_NOT_DEFINED, EINVAL ),
108 STATUS_NOT_OWNER =
109 STATUS_BUILD( STATUS_CLASSIC_NOT_OWNER_OF_RESOURCE, EPERM ),
110 STATUS_OBJECT_WAS_DELETED =
111 STATUS_BUILD( STATUS_CLASSIC_OBJECT_WAS_DELETED, EINVAL ),
112 STATUS_PROXY_BLOCKING =
113 STATUS_BUILD( STATUS_CLASSIC_PROXY_BLOCKING, EINVAL ),
114 STATUS_RESOURCE_IN_USE =
115 STATUS_BUILD( STATUS_CLASSIC_RESOURCE_IN_USE, EBUSY ),
116 STATUS_RESULT_TOO_LARGE =
117 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, ERANGE ),
118 STATUS_SUCCESSFUL =
119 STATUS_BUILD( STATUS_CLASSIC_SUCCESSFUL, 0 ),
120 STATUS_TIMEOUT =
121 STATUS_BUILD( STATUS_CLASSIC_TIMEOUT, ETIMEDOUT ),
122 STATUS_TOO_MANY =
123 STATUS_BUILD( STATUS_CLASSIC_TOO_MANY, EAGAIN ),
124 STATUS_UNAVAILABLE =
125 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EBUSY ),
126 STATUS_UNSATISFIED =
127 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EAGAIN )
128} Status_Control;
129
130#ifdef __cplusplus
131}
132#endif /* __cplusplus */
133
134#endif /* _RTEMS_SCORE_STATUS_H */
basedefs.h
Basic Definitions.
pthread.h
POSIX Threads Private Support.