RTEMS  5.1
error.h
Go to the documentation of this file.
1 
47 #ifndef _RTEMS_RTEMS_ERROR_H
48 #define _RTEMS_RTEMS_ERROR_H
49 
50 #include <rtems/rtems/status.h>
51 #include <rtems/fatal.h>
52 
53 #include <stdarg.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
67 typedef Internal_errors_t rtems_error_code_t;
68 
69 /*
70  * rtems_error(), rtems_verror() and rtems_panic() support
71  */
72 
73 #if 0
74 /* not 16bit-int host clean */
75 #define RTEMS_ERROR_ERRNO (1<<((sizeof(rtems_error_code_t) * CHAR_BIT) - 2)) /* hi bit; use 'errno' */
76 #define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
77 #define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
78 #else
79 #define RTEMS_ERROR_ERRNO (0x40000000) /* hi bit; use 'errno' */
80 #define RTEMS_ERROR_PANIC (0x20000000) /* err fatal; no return */
81 #define RTEMS_ERROR_ABORT (0x10000000) /* err is fatal; panic */
82 #endif
83 
84 #define RTEMS_ERROR_MASK \
85  (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | RTEMS_ERROR_PANIC) /* all */
86 
100 int rtems_error(
101  rtems_error_code_t error_code,
102  const char *printf_format,
103  ...
104 );
105 
121 int rtems_verror(
122  rtems_error_code_t error_code,
123  const char *printf_format,
124  va_list arglist
125 );
126 
127 extern int rtems_panic_in_progress;
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 
134 #endif
135 /* end of include file */
int rtems_verror(rtems_error_code_t error_code, const char *printf_format, va_list arglist)
Report an Error.
Definition: error.c:27
int rtems_error(rtems_error_code_t error_code, const char *printf_format,...)
Report an Error.
Definition: error.c:77
Fatal API.