summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectextendinformation.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-05 20:09:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-05 20:09:02 +0000
commitb028e725e35629e0405d237942e97a73843ae35b (patch)
tree5cac5182644fcd11fe996272790b2b9a62cec67b /cpukit/score/src/objectextendinformation.c
parent2009-01-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-b028e725e35629e0405d237942e97a73843ae35b.tar.bz2
2009-01-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/include/rtems/score/object.h, score/src/objectallocatebyindex.c: Object index should be int. Fix bug when index is negative. * score/src/objectextendinformation.c: Do not allow maximum number of allocated objects to exceed maximum representable in index field of Object Id. * score/src/objectgetisr.c: Use same code that is in _Objects_Get to extract index field of Object Id.
Diffstat (limited to 'cpukit/score/src/objectextendinformation.c')
-rw-r--r--cpukit/score/src/objectextendinformation.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c
index 4e525110a9..f699e940a3 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -114,6 +114,14 @@ void _Objects_Extend_information(
maximum = 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 )
+ return;
+
+ /*
* Allocate the tables and break it up.
*/