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.
This commit is contained in:
Joel Sherrill
2010-03-10 18:15:33 +00:00
parent 05f7e55c46
commit eabaf58988
3 changed files with 19 additions and 1 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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
*/