summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-10 10:46:52 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-12 09:08:40 +0100
commit36e59b2bbc8737c4ba1b93ac0f695528a36844c9 (patch)
tree0757387b86637fd42e78dd1af33888d3fde71836
parent8e118f2275bf1093b0ed3c66a7bd7535fd61b29e (diff)
score: _Objects_Extend_information()
Return block index in _Objects_Extend_information(). This allows to customize the objects information extend. Update #3835.
-rw-r--r--cpukit/include/rtems/score/objectimpl.h5
-rw-r--r--cpukit/score/src/objectextendinformation.c21
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 <string.h> /* 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;
}