Introduce rtems_error_code_t.

Minor portability code-massaging.
This commit is contained in:
Ralf Corsepius
2009-10-12 16:17:19 +00:00
parent bff419ffc2
commit 8ed3d52ee7

View File

@@ -11,15 +11,19 @@
#ifndef _RTEMS_RTEMS_ERROR_H #ifndef _RTEMS_RTEMS_ERROR_H
#define _RTEMS_RTEMS_ERROR_H #define _RTEMS_RTEMS_ERROR_H
#include <rtems/score/interr.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef Internal_errors_t rtems_error_code_t;
/* /*
* rtems_error() and rtems_panic() support * rtems_error() and rtems_panic() support
*/ */
#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */ #define RTEMS_ERROR_ERRNO (1<<((sizeof(rtems_error_code_t) * CHAR_BIT) - 2)) /* hi bit; use 'errno' */
#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */ #define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */ #define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
@@ -27,7 +31,7 @@ extern "C" {
RTEMS_ERROR_PANIC) /* all */ RTEMS_ERROR_PANIC) /* all */
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); int rtems_error(rtems_error_code_t error_code, const char *printf_format, ...);
#ifdef __GNUC__ #ifdef __GNUC__
void rtems_panic(const char *printf_format, ...); void rtems_panic(const char *printf_format, ...);
/* /*