From eabaf589884f22e6b45e0362562ba7cc12e0aa49 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 10 Mar 2010 18:15:33 +0000 Subject: [PATCH] 2010-03-10 Joel Sherrill * score/include/rtems/score/interr.h, score/src/objectinitializeinformation.c: Add new fatal error for configuring unlimited and maximum of 0. --- cpukit/ChangeLog | 6 ++++++ cpukit/score/include/rtems/score/interr.h | 3 ++- cpukit/score/src/objectinitializeinformation.c | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) 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 + + * 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 * 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 @@ -98,6 +98,17 @@ void _Objects_Initialize_information( (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 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 */