summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2009-10-22 11:20:44 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2009-10-22 11:20:44 +0000
commitc38407e6bed5ed20bf9dbecd60f15f1bc0402919 (patch)
tree6baecee90a8b07377dfbcc21f13431aedd01bff7
parent2009-10-22 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-c38407e6bed5ed20bf9dbecd60f15f1bc0402919.tar.bz2
2009-10-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/error.h: Use ordinal constants for RTEMS_ERROR_ERRNO, RTEMS_ERROR_PANIC, RTEMS_ERROR_ABORT to avoid implicit constant conversion overflows on 16bit-int targets.
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/libcsupport/include/rtems/error.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index e7501be7a2..446e351805 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,11 @@
2009-10-22 Ralf Corsépius <ralf.corsepius@rtems.org>
+ * libcsupport/include/rtems/error.h: Use ordinal constants for
+ RTEMS_ERROR_ERRNO, RTEMS_ERROR_PANIC, RTEMS_ERROR_ABORT to avoid
+ implicit constant conversion overflows on 16bit-int targets.
+
+2009-10-22 Ralf Corsépius <ralf.corsepius@rtems.org>
+
* libmisc/uuid/uuid_time.c: Add cast to uint32_t to allow 16bit
shift on 16bit-int targets.
* libmisc/uuid/gen_uuid.c: Add HAVE_CONFIG_H guard.
diff --git a/cpukit/libcsupport/include/rtems/error.h b/cpukit/libcsupport/include/rtems/error.h
index e79cd9d1d2..ec5dec99d9 100644
--- a/cpukit/libcsupport/include/rtems/error.h
+++ b/cpukit/libcsupport/include/rtems/error.h
@@ -23,9 +23,16 @@ typedef Internal_errors_t rtems_error_code_t;
* rtems_error() and rtems_panic() support
*/
+#if 0
+/* not 16bit-int host clean */
#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_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
+#else
+#define RTEMS_ERROR_ERRNO (0x40000000) /* hi bit; use 'errno' */
+#define RTEMS_ERROR_PANIC (0x20000000) /* err fatal; no return */
+#define RTEMS_ERROR_ABORT (0x10000000) /* err is fatal; panic */
+#endif
#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
RTEMS_ERROR_PANIC) /* all */