4.104.114.84.95
Line | |
---|
1 | /** |
---|
2 | * @file rtems/error.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Defines and externs for rtems error reporting |
---|
7 | * |
---|
8 | * $Id$ |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef _RTEMS_RTEMS_ERROR_H |
---|
12 | #define _RTEMS_RTEMS_ERROR_H |
---|
13 | |
---|
14 | #ifdef __cplusplus |
---|
15 | extern "C" { |
---|
16 | #endif |
---|
17 | |
---|
18 | /* |
---|
19 | * rtems_error() and rtems_panic() support |
---|
20 | */ |
---|
21 | |
---|
22 | #define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */ |
---|
23 | #define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */ |
---|
24 | #define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */ |
---|
25 | |
---|
26 | #define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \ |
---|
27 | RTEMS_ERROR_PANIC) /* all */ |
---|
28 | |
---|
29 | const char *rtems_status_text(rtems_status_code); |
---|
30 | int rtems_error(int error_code, const char *printf_format, ...); |
---|
31 | #ifdef __GNUC__ |
---|
32 | void rtems_panic(const char *printf_format, ...); |
---|
33 | /* |
---|
34 | * We should be able to use this attribute but gcc complains that |
---|
35 | * rtems_panic does in fact return. :( |
---|
36 | * |
---|
37 | * __attribute__ ((__noreturn__)); |
---|
38 | */ |
---|
39 | #else |
---|
40 | void rtems_panic(const char *printf_format, ...); |
---|
41 | #endif |
---|
42 | |
---|
43 | extern int rtems_panic_in_progress; |
---|
44 | |
---|
45 | #ifdef __cplusplus |
---|
46 | } |
---|
47 | #endif |
---|
48 | |
---|
49 | |
---|
50 | #endif |
---|
51 | /* end of include file */ |
---|
Note: See
TracBrowser
for help on using the repository browser.