forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
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.
|
||||
|
||||
2001-10-22 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
|
||||
@@ -454,6 +454,11 @@ Objects_Control *_Objects_Get_isr_disable(
|
||||
ISR_Level *level
|
||||
);
|
||||
|
||||
Objects_Control *_Objects_Get_by_index (
|
||||
Objects_Information *information,
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
/*
|
||||
* _Objects_Get_next
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user