diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-06 20:39:27 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-06 20:39:27 +0000 |
commit | 684e243dd0a102fd7ba6e68721f9930f930a42ff (patch) | |
tree | 386550b2cf5522d92b88331948b6c2acbac7f692 /cpukit | |
parent | 2009-08-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-684e243dd0a102fd7ba6e68721f9930f930a42ff.tar.bz2 |
Revert.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/Makefile.am | 2 | ||||
-rw-r--r-- | cpukit/rtems/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/sapi/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/src/objectextendinformation.c | 71 |
5 files changed, 49 insertions, 27 deletions
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index ad50d80723..8b59c5830a 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -113,8 +113,6 @@ libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c src/printk.c \ $(BSD_LIBC_C_FILES) $(BASE_FS_C_FILES) $(MALLOC_C_FILES) \ $(ERROR_C_FILES) $(ASSOCIATION_C_FILES) -libcsupport_a_SOURCES += src/end_profile.c - if UNIX libcsupport_a_SOURCES += src/unixlibc.c src/unixlibc_io.c src/hosterr.c else diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am index 863652e8f9..400fc40ad7 100644 --- a/cpukit/rtems/Makefile.am +++ b/cpukit/rtems/Makefile.am @@ -7,7 +7,6 @@ include $(top_srcdir)/automake/compile.am AM_CPPFLAGS += -D__RTEMS_INSIDE__ -project_lib_LIBRARIES = librtems.a noinst_LIBRARIES = librtems.a librtems_a_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am index 605cf84324..d279aa88e9 100644 --- a/cpukit/sapi/Makefile.am +++ b/cpukit/sapi/Makefile.am @@ -20,7 +20,6 @@ include_rtems_HEADERS += inline/rtems/chain.inl \ ## src AM_CPPFLAGS += -D__RTEMS_INSIDE__ -project_lib_LIBRARIES = libsapi.a noinst_LIBRARIES = libsapi.a libsapi_a_SOURCES = src/debug.c src/extension.c src/extensioncreate.c \ src/extensiondelete.c src/extensionident.c src/fatal.c src/exinit.c \ diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 12a4be81f7..de06241bd0 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -73,7 +73,6 @@ endif AM_CPPFLAGS += -D__RTEMS_INSIDE__ -project_lib_LIBRARIES = libscore.a noinst_LIBRARIES = libscore.a libscore_a_SOURCES = libscore_a_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index 6718122abf..0a3558318f 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -53,6 +53,7 @@ void _Objects_Extend_information( uint32_t index_base; uint32_t minimum_index; uint32_t index; + void *new_object_block; /* * Search for a free block of indexes. The block variable ends up set @@ -77,6 +78,29 @@ void _Objects_Extend_information( } /* + * Allocate the name table, and the objects and if it fails either return or + * generate a fatal error depending on auto-extending being active. + */ + + new_object_block = + _Workspace_Allocate( + (information->allocation_size * information->size) + ); + + if ( new_object_block == NULL ) { + if ( information->auto_extend ) { + return; + } + else { + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_WORKSPACE_ALLOCATION + ); + } + } + + /* * If the index_base is the maximum we need to grow the tables. */ @@ -112,15 +136,23 @@ void _Objects_Extend_information( block_count++; - maximum = information->maximum + information->allocation_size; + maximum = (uint32_t) information->maximum + information->allocation_size; /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ - if ( maximum > OBJECTS_ID_FINAL_INDEX ) + if ( maximum > OBJECTS_ID_FINAL_INDEX ) { + if ( !_Workspace_Free( new_object_block ) ) { + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_WORKSPACE_ALLOCATION + ); + } return; + } /* * Allocate the tables and break it up. @@ -131,9 +163,17 @@ void _Objects_Extend_information( ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); - if ( !object_blocks ) + if ( !object_blocks ) { + if ( !_Workspace_Free( new_object_block ) ) { + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_WORKSPACE_ALLOCATION + ); + } return; - + } + /* * Break the block into the various sections. */ @@ -197,7 +237,7 @@ void _Objects_Extend_information( information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; - information->maximum = maximum; + information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( information->the_api, information->the_class, @@ -214,24 +254,10 @@ void _Objects_Extend_information( } /* - * Allocate the name table, and the objects + * Assign the new object block to the object block table. */ - if ( information->auto_extend ) { - information->object_blocks[ block ] = - _Workspace_Allocate( - (information->allocation_size * information->size) - ); - - if ( !information->object_blocks[ block ] ) - return; - } - else { - information->object_blocks[ block ] = - _Workspace_Allocate_or_fatal_error( - (information->allocation_size * information->size) - ); - } + information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. @@ -265,5 +291,6 @@ void _Objects_Extend_information( } information->inactive_per_block[ block ] = information->allocation_size; - information->inactive += information->allocation_size; + information->inactive = + (Objects_Maximum)(information->inactive + information->allocation_size); } |