diff options
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/interr.h | 3 | ||||
-rw-r--r-- | cpukit/score/src/objectinitializeinformation.c | 11 |
3 files changed, 19 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index e562cbd5dd..ed134541f4 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-03-10 Joel Sherrill <joel.sherrill@oarcorp.com> + + * score/include/rtems/score/interr.h, + score/src/objectinitializeinformation.c: Add new fatal error for + configuring unlimited and maximum of 0. + 2010-03-09 Joel Sherrill <joel.sherrilL@oarcorp.com> * libmisc/Makefile.am: Remove duplicate file from list. diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index eb654d441f..775c664a77 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -70,7 +70,8 @@ typedef enum { INTERNAL_ERROR_BAD_ATTRIBUTES, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY, INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL, - INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE + INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE, + INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 } Internal_errors_Core_list; typedef uint32_t Internal_errors_t; diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c index da357708f1..050df7861e 100644 --- a/cpukit/score/src/objectinitializeinformation.c +++ b/cpukit/score/src/objectinitializeinformation.c @@ -99,6 +99,17 @@ void _Objects_Initialize_information( maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; /* + * Unlimited and maximum of zero is illogical. + */ + if ( information->auto_extend && maximum_per_allocation == 0) { + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 + ); + } + + /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; |