From 36e59b2bbc8737c4ba1b93ac0f695528a36844c9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 10 Dec 2019 10:46:52 +0100 Subject: score: _Objects_Extend_information() Return block index in _Objects_Extend_information(). This allows to customize the objects information extend. Update #3835. --- cpukit/include/rtems/score/objectimpl.h | 5 ++++- cpukit/score/src/objectextendinformation.c | 21 ++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h index 87d29cb087..d4d6347ea8 100644 --- a/cpukit/include/rtems/score/objectimpl.h +++ b/cpukit/include/rtems/score/objectimpl.h @@ -91,8 +91,11 @@ _Objects_Information_table[ OBJECTS_APIS_LAST + 1 ]; * @brief Extends an object class information record. * * @param information Points to an object class information block. + * + * @retval 0 The extend operation failed. + * @retval block The block index of the new objects block. */ -void _Objects_Extend_information( +Objects_Maximum _Objects_Extend_information( Objects_Information *information ); diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index 688d0f90bb..65fef94e44 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -28,18 +28,7 @@ #include /* for memcpy() */ -/* - * _Objects_Extend_information - * - * This routine extends all object information related data structures. - * - * Input parameters: - * information - object information table - * - * Output parameters: NONE - */ - -void _Objects_Extend_information( +Objects_Maximum _Objects_Extend_information( Objects_Information *information ) { @@ -98,7 +87,7 @@ void _Objects_Extend_information( * case of 16-bit Ids, this is only 256 object instances. */ if ( new_maximum > OBJECTS_ID_FINAL_INDEX ) { - return; + return 0; } /* @@ -108,7 +97,7 @@ void _Objects_Extend_information( object_block_size = extend_count * information->object_size; new_object_block = _Workspace_Allocate( object_block_size ); if ( new_object_block == NULL ) { - return; + return 0; } /* @@ -157,7 +146,7 @@ void _Objects_Extend_information( object_blocks = _Workspace_Allocate( table_size ); if ( object_blocks == NULL ) { _Workspace_Free( new_object_block ); - return; + return 0; } /* @@ -249,4 +238,6 @@ void _Objects_Extend_information( the_object = _Addresses_Add_offset( the_object, information->object_size ); } + + return block; } -- cgit v1.2.3