diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-07 22:51:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-07 22:51:28 +0000 |
commit | 7d573e9e15fb5b208a297225d0082d08fc50c757 (patch) | |
tree | bf97ecaf93a5a98df9909de99e66080990258735 | |
parent | 2001-11-01 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-7d573e9e15fb5b208a297225d0082d08fc50c757.tar.bz2 |
2001-11-07 Joel Sherrill <joel@OARcorp.com>
* include/rtems/score/object.h: Added prototype for
_Objects_Get_by_index().
* src/objectget.c: Corrected procedure for getting index from Id so
it is correct and optimal for both single and multiprocessor
configurations.
-rw-r--r-- | c/src/exec/score/include/rtems/score/object.h | 6 | ||||
-rw-r--r-- | c/src/exec/score/src/objectget.c | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/c/src/exec/score/include/rtems/score/object.h b/c/src/exec/score/include/rtems/score/object.h index 811e33a17e..250a22484f 100644 --- a/c/src/exec/score/include/rtems/score/object.h +++ b/c/src/exec/score/include/rtems/score/object.h @@ -443,6 +443,12 @@ Objects_Control *_Objects_Get ( Objects_Locations *location ); +Objects_Control *_Objects_Get_by_index ( + Objects_Information *information, + Objects_Id id, + Objects_Locations *location +); + /* * _Objects_Get_next * diff --git a/c/src/exec/score/src/objectget.c b/c/src/exec/score/src/objectget.c index 91e44d28cf..dd49f6f014 100644 --- a/c/src/exec/score/src/objectget.c +++ b/c/src/exec/score/src/objectget.c @@ -53,11 +53,18 @@ Objects_Control *_Objects_Get( Objects_Control *the_object; unsigned32 index; - index = _Objects_Get_index( id ); +#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 ) { _Thread_Disable_dispatch(); - if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) { + if ( (the_object = information->local_table[ index ]) != NULL ) { *location = OBJECTS_LOCAL; return( the_object ); } @@ -67,12 +74,7 @@ Objects_Control *_Objects_Get( } *location = OBJECTS_ERROR; #if defined(RTEMS_MULTIPROCESSING) - _Objects_MP_Is_remote( - information, - _Objects_Build_id( information->the_class, _Objects_Local_node, index ), - location, - &the_object - ); + _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; #else return NULL; |