summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/ChangeLog9
-rw-r--r--cpukit/score/src/coremsgseize.c4
-rw-r--r--cpukit/score/src/objectallocate.c18
3 files changed, 27 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index aaeaf31de2..6fcda32692 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,14 @@
2007-05-11 Joel Sherrill <joel.sherrill@OARcorp.com>
+ * score/src/coremsgseize.c: A blocking sender's message size was
+ pulled out of the wrong field in the Wait information structure.
+ * score/src/objectallocate.c: With the new optional manager support,
+ we only stub out the initialization. This makes it possible to attempt
+ to create an object with the information structure only initialized
+ with all zeros. This ensures we return an error cleanly in this case.
+
+2007-05-11 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* rtems/src/region.c, sapi/src/exinit.c: Now that the Region is
an optional manager, we cannot depend on it do initialize the
internal Allocator Mutex. This was always a questionable place to
diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c
index a71f1de794..fc11e3e80d 100644
--- a/cpukit/score/src/coremsgseize.c
+++ b/cpukit/score/src/coremsgseize.c
@@ -7,7 +7,7 @@
* This core object provides task synchronization and communication functions
* via messages passed to queue objects.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -107,7 +107,7 @@ void _CORE_message_queue_Seize(
*/
the_message->priority = the_thread->Wait.count;
- the_message->Contents.size = (uint32_t )the_thread->Wait.return_argument_1;
+ the_message->Contents.size = (uint32_t)the_thread->Wait.option;
_CORE_message_queue_Copy_buffer(
the_thread->Wait.return_argument,
the_message->Contents.buffer,
diff --git a/cpukit/score/src/objectallocate.c b/cpukit/score/src/objectallocate.c
index c2a6b5efe2..c924f39453 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -42,8 +42,22 @@ Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
- Objects_Control *the_object =
- (Objects_Control *) _Chain_Get( &information->Inactive );
+ Objects_Control *the_object;
+
+ /*
+ * If the application is using the optional manager stubs and
+ * still attempts to create the object, the information block
+ * should be all zeroed out because it is in the BSS. So let's
+ * check that code for this manager is even present.
+ */
+ if ( information->size == 0 )
+ return NULL;
+
+ /*
+ * OK. The manager should be initialized and configured to have objects.
+ * With any luck, it is safe to attempt to allocate an object.
+ */
+ the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
if ( information->auto_extend ) {
/*