summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-07 22:42:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-07 22:42:04 +0000
commitc31c15c16c47df7361ef0afc992f560a947a552b (patch)
tree7ccd6d3f5667c954db50a329a43f32d8ad000128 /c/src/exec/score/src
parent850f87e5c9ea6da35a858c8870536f2d126274c4 (diff)
downloadrtems-c31c15c16c47df7361ef0afc992f560a947a552b.tar.bz2
2001-11-07 Joel Sherrill <joel@OARcorp.com>
Reported by Todor.Todorov@barco.com and tracked as PR36. * include/rtems/score/object.h: Added prototype for _Objects_Get_by_index(). * src/objectget.c, src/objectgetisr.c: Corrected procedure for getting index from Id so it is correct and optimal for both single and multiprocessor configurations.
Diffstat (limited to 'c/src/exec/score/src')
-rw-r--r--c/src/exec/score/src/objectget.c6
-rw-r--r--c/src/exec/score/src/objectgetisr.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/c/src/exec/score/src/objectget.c b/c/src/exec/score/src/objectget.c
index 4c30d2a008..8a551c6741 100644
--- a/c/src/exec/score/src/objectget.c
+++ b/c/src/exec/score/src/objectget.c
@@ -53,12 +53,16 @@ Objects_Control *_Objects_Get(
Objects_Control *the_object;
unsigned32 index;
+#if defined(RTEMS_MULTIPROCESSING)
+ index = id - information->minimum_id + 1;
+#else
/* index = _Objects_Get_index( id ); */
index = id & 0x0000ffff;
/* This should work but doesn't always :( */
/* index = (unsigned16) id; */
+#endif
- if ( information->maximum >= index ) {
+ if ( information->maximum >= index ) {
_Thread_Disable_dispatch();
if ( (the_object = information->local_table[ index ]) != NULL ) {
*location = OBJECTS_LOCAL;
diff --git a/c/src/exec/score/src/objectgetisr.c b/c/src/exec/score/src/objectgetisr.c
index 9d0951d9fd..18ca18cd5c 100644
--- a/c/src/exec/score/src/objectgetisr.c
+++ b/c/src/exec/score/src/objectgetisr.c
@@ -57,10 +57,14 @@ Objects_Control *_Objects_Get_isr_disable(
unsigned32 index;
ISR_Level level;
+#if defined(RTEMS_MULTIPROCESSING)
+ index = id - information->minimum_id + 1;
+#else
/* index = _Objects_Get_index( id ); */
index = id & 0x0000ffff;
/* This should work but doesn't always :( */
/* index = (unsigned16) id; */
+#endif
_ISR_Disable( level );
if ( information->maximum >= index ) {