RTEMS CPU Kit with SuperCore
4.11.3
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
v
w
+
Variables
_
b
c
d
i
r
+
Typedefs
a
b
c
d
f
h
i
m
o
p
q
r
s
t
u
w
x
+
Enumerations
b
c
d
e
h
i
m
o
p
r
s
t
w
+
Enumerator
c
i
m
p
r
s
t
w
+
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
mnt
data0
chrisj
rtems
releases
rtems-release.git
4.11.3
ws-rtems
rtems-4.11.3
cpukit
include
rtems
status-checks.h
Go to the documentation of this file.
1
10
/*
11
* Copyright (c) 2008
12
* Embedded Brains GmbH
13
* Obere Lagerstr. 30
14
* D-82178 Puchheim
15
* Germany
16
* rtems@embedded-brains.de
17
*
18
* The license and distribution terms for this file may be
19
* found in the file LICENSE in this distribution or at
20
* http://www.rtems.org/license/LICENSE.
21
*/
22
23
#ifndef RTEMS_STATUS_CHECKS_H
24
#define RTEMS_STATUS_CHECKS_H
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
/* __cplusplus */
29
43
#ifdef DEBUG
44
#ifndef RTEMS_DEBUG_PRINT
45
#ifdef RTEMS_STATUS_CHECKS_USE_PRINTK
46
#define RTEMS_DEBUG_PRINT( fmt, ...) \
47
printk( "%s: " fmt, __func__, ##__VA_ARGS__)
48
#else
/* RTEMS_STATUS_CHECKS_USE_PRINTK */
49
#include <stdio.h>
50
#define RTEMS_DEBUG_PRINT( fmt, ...) \
51
printf( "%s: " fmt, __func__, ##__VA_ARGS__)
52
#endif
/* RTEMS_STATUS_CHECKS_USE_PRINTK */
53
#endif
/* RTEMS_DEBUG_PRINT */
54
#else
/* DEBUG */
55
#ifdef RTEMS_DEBUG_PRINT
56
#warning RTEMS_DEBUG_PRINT was defined, but DEBUG was undefined
57
#undef RTEMS_DEBUG_PRINT
58
#endif
/* RTEMS_DEBUG_PRINT */
59
#define RTEMS_DEBUG_PRINT( fmt, ...)
60
#endif
/* DEBUG */
61
65
#define RTEMS_DEBUG_OK( msg) \
66
RTEMS_DEBUG_PRINT( "Ok: %s\n", msg)
67
71
#ifndef RTEMS_SYSLOG_PRINT
72
#ifdef RTEMS_STATUS_CHECKS_USE_PRINTK
73
#define RTEMS_SYSLOG_PRINT( fmt, ...) \
74
printk( fmt, ##__VA_ARGS__)
75
#else
/* RTEMS_STATUS_CHECKS_USE_PRINTK */
76
#include <stdio.h>
77
#define RTEMS_SYSLOG_PRINT( fmt, ...) \
78
printf( fmt, ##__VA_ARGS__)
79
#endif
/* RTEMS_STATUS_CHECKS_USE_PRINTK */
80
#endif
/* RTEMS_SYSLOG_PRINT */
81
85
#define RTEMS_SYSLOG( fmt, ...) \
86
RTEMS_SYSLOG_PRINT( "%s: " fmt, __func__, ##__VA_ARGS__)
87
91
#define RTEMS_SYSLOG_WARNING( fmt, ...) \
92
RTEMS_SYSLOG( "Warning: " fmt, ##__VA_ARGS__)
93
98
#define RTEMS_SYSLOG_WARNING_SC( sc, msg) \
99
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
100
RTEMS_SYSLOG_WARNING( "SC = %i: %s\n", (int) sc, msg); \
101
}
102
106
#define RTEMS_SYSLOG_ERROR( fmt, ...) \
107
RTEMS_SYSLOG( "Error: " fmt, ##__VA_ARGS__)
108
112
#define RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg) \
113
RTEMS_SYSLOG_ERROR( "SC = %i: %s\n", (int) sc, msg);
114
118
#define RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg) \
119
RTEMS_SYSLOG_ERROR( "RV = %i: %s\n", (int) rv, msg);
120
125
#define RTEMS_SYSLOG_ERROR_SC( sc, msg) \
126
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
127
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
128
}
129
134
#define RTEMS_SYSLOG_ERROR_RV( rv, msg) \
135
if ((int) (rv) < 0) { \
136
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
137
}
138
150
#define RTEMS_CHECK_SC( sc, msg) \
151
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
152
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
153
return (rtems_status_code) sc; \
154
} else { \
155
RTEMS_DEBUG_OK( msg); \
156
}
157
162
#define RTEMS_CHECK_SC_RV( sc, msg) \
163
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
164
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
165
return -((int) (sc)); \
166
} else { \
167
RTEMS_DEBUG_OK( msg); \
168
}
169
174
#define RTEMS_CHECK_SC_VOID( sc, msg) \
175
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
176
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
177
return; \
178
} else { \
179
RTEMS_DEBUG_OK( msg); \
180
}
181
186
#define RTEMS_CHECK_SC_TASK( sc, msg) \
187
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
188
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
189
(void) rtems_task_delete( RTEMS_SELF); \
190
return; \
191
} else { \
192
RTEMS_DEBUG_OK( msg); \
193
}
194
199
#define RTEMS_CHECK_RV( rv, msg) \
200
if ((int) (rv) < 0) { \
201
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
202
return (int) rv; \
203
} else { \
204
RTEMS_DEBUG_OK( msg); \
205
}
206
211
#define RTEMS_CHECK_RV_SC( rv, msg) \
212
if ((int) (rv) < 0) { \
213
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
214
return RTEMS_IO_ERROR; \
215
} else { \
216
RTEMS_DEBUG_OK( msg); \
217
}
218
223
#define RTEMS_CHECK_RV_VOID( rv, msg) \
224
if ((int) (rv) < 0) { \
225
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
226
return; \
227
} else { \
228
RTEMS_DEBUG_OK( msg); \
229
}
230
235
#define RTEMS_CHECK_RV_TASK( rv, msg) \
236
if ((int) (rv) < 0) { \
237
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
238
(void) rtems_task_delete( RTEMS_SELF); \
239
return; \
240
} else { \
241
RTEMS_DEBUG_OK( msg); \
242
}
243
255
#define RTEMS_CLEANUP_SC( sc, label, msg) \
256
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
257
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
258
goto label; \
259
} else { \
260
RTEMS_DEBUG_OK( msg); \
261
}
262
268
#define RTEMS_CLEANUP_SC_RV( sc, rv, label, msg) \
269
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
270
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
271
rv = -((int) (sc)); \
272
goto label; \
273
} else { \
274
RTEMS_DEBUG_OK( msg); \
275
}
276
281
#define RTEMS_CLEANUP_RV( rv, label, msg) \
282
if ((int) (rv) < 0) { \
283
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
284
goto label; \
285
} else { \
286
RTEMS_DEBUG_OK( msg); \
287
}
288
294
#define RTEMS_CLEANUP_RV_SC( rv, sc, label, msg) \
295
if ((int) (rv) < 0) { \
296
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
297
sc = RTEMS_IO_ERROR; \
298
goto label; \
299
} else { \
300
RTEMS_DEBUG_OK( msg); \
301
}
302
306
#define RTEMS_DO_CLEANUP( label, msg) \
307
do { \
308
RTEMS_SYSLOG_ERROR( msg); \
309
goto label; \
310
} while (0)
311
316
#define RTEMS_DO_CLEANUP_SC( val, sc, label, msg) \
317
do { \
318
sc = (rtems_status_code) val; \
319
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
320
goto label; \
321
} while (0)
322
327
#define RTEMS_DO_CLEANUP_RV( val, rv, label, msg) \
328
do { \
329
rv = (int) val; \
330
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
331
goto label; \
332
} while (0)
333
338
#ifdef __cplusplus
339
}
340
#endif
/* __cplusplus */
341
342
#endif
/* RTEMS_STATUS_CHECKS_H */
Generated by
1.8.13