diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-09 20:49:44 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-09 20:49:44 +0000 |
commit | 4ff7e0f401e727b8b89e3408403574ff4bcd9751 (patch) | |
tree | 740be9aa000f2c41134e467a73758d6db2950a37 /cpukit | |
parent | 2008-01-09 Eric Norum <norume@aps.anl.gov> (diff) | |
download | rtems-4ff7e0f401e727b8b89e3408403574ff4bcd9751.tar.bz2 |
2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/objectgetnoprotection.c: Eliminate duplicate exit path code
when there is an error.
Diffstat (limited to '')
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/score/src/objectgetnoprotection.c | 24 |
2 files changed, 15 insertions, 14 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 43424c04c0..2981eed0bf 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com> + + * score/src/objectgetnoprotection.c: Eliminate duplicate exit path code + when there is an error. + 2008-01-09 Jennifer Averett <jennifer.averett@OARcorp.com> * posix/src/keycreate.c, rtems/src/eventseize.c, diff --git a/cpukit/score/src/objectgetnoprotection.c b/cpukit/score/src/objectgetnoprotection.c index d8df70cd46..d969477747 100644 --- a/cpukit/score/src/objectgetnoprotection.c +++ b/cpukit/score/src/objectgetnoprotection.c @@ -57,27 +57,23 @@ Objects_Control *_Objects_Get_no_protection( Objects_Control *the_object; uint32_t index; -#if defined(RTEMS_MULTIPROCESSING) + /* + * You can't just extract the index portion or you can get tricked + * by a value between 1 and maximum. + */ index = id - information->minimum_id + 1; -#else - /* index = _Objects_Get_index( id ); */ - index = id & 0x0000ffff; - /* This should work but doesn't always :( */ - /* index = (uint16_t ) id; */ -#endif - if ( information->maximum >= index ) { + if ( information->maximum >= index ) { if ( (the_object = information->local_table[ index ]) != NULL ) { *location = OBJECTS_LOCAL; return the_object; } - *location = OBJECTS_ERROR; - return NULL; } - *location = OBJECTS_ERROR; -/* - * Not supported for multiprocessing - */ + /* + * This isn't supported or required yet for Global objects so + * if it isn't local, we don't find it. + */ + *location = OBJECTS_ERROR; return NULL; } |