summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-06 19:09:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-06 19:09:27 +0000
commit3b4413c08f0e028f0095ec5b50f90e4169e6689b (patch)
tree23a0d5308d568e8f2daabfc6ee19377e8dcb032d
parentNew file. Convert ID to pointer and return with interrupts -- not (diff)
downloadrtems-3b4413c08f0e028f0095ec5b50f90e4169e6689b.tar.bz2
Directly index local table to avoid error check.
-rw-r--r--c/src/exec/score/src/objectallocatebyindex.c2
-rw-r--r--c/src/exec/score/src/objectget.c17
-rw-r--r--c/src/exec/score/src/objectgetbyindex.c3
-rw-r--r--cpukit/score/src/objectallocatebyindex.c2
-rw-r--r--cpukit/score/src/objectget.c17
-rw-r--r--cpukit/score/src/objectgetbyindex.c3
6 files changed, 20 insertions, 24 deletions
diff --git a/c/src/exec/score/src/objectallocatebyindex.c b/c/src/exec/score/src/objectallocatebyindex.c
index d46399c535..6de641ae0c 100644
--- a/c/src/exec/score/src/objectallocatebyindex.c
+++ b/c/src/exec/score/src/objectallocatebyindex.c
@@ -44,7 +44,7 @@ Objects_Control *_Objects_Allocate_by_index(
Objects_Control *the_object;
if ( index && information->maximum >= index ) {
- the_object = _Objects_Get_local_object( information, index );
+ the_object = information->local_table[ index ];
if ( the_object )
return NULL;
diff --git a/c/src/exec/score/src/objectget.c b/c/src/exec/score/src/objectget.c
index 91e44d28cf..01d8683ca7 100644
--- a/c/src/exec/score/src/objectget.c
+++ b/c/src/exec/score/src/objectget.c
@@ -53,26 +53,23 @@ Objects_Control *_Objects_Get(
Objects_Control *the_object;
unsigned32 index;
- index = _Objects_Get_index( id );
+ /* index = _Objects_Get_index( id ); */
+ index = (unsigned16) id;
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 );
+ return the_object;
}
_Thread_Enable_dispatch();
*location = OBJECTS_ERROR;
- return( NULL );
+ return NULL;
}
*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;
diff --git a/c/src/exec/score/src/objectgetbyindex.c b/c/src/exec/score/src/objectgetbyindex.c
index 6cfc2b98cd..7c7c89c2af 100644
--- a/c/src/exec/score/src/objectgetbyindex.c
+++ b/c/src/exec/score/src/objectgetbyindex.c
@@ -54,7 +54,8 @@ Objects_Control *_Objects_Get_by_index(
if ( information->maximum >= index ) {
_Thread_Disable_dispatch();
- if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
+ the_object = information->local_table[ index ];
+ if ( the_object ) {
*location = OBJECTS_LOCAL;
return( the_object );
}
diff --git a/cpukit/score/src/objectallocatebyindex.c b/cpukit/score/src/objectallocatebyindex.c
index d46399c535..6de641ae0c 100644
--- a/cpukit/score/src/objectallocatebyindex.c
+++ b/cpukit/score/src/objectallocatebyindex.c
@@ -44,7 +44,7 @@ Objects_Control *_Objects_Allocate_by_index(
Objects_Control *the_object;
if ( index && information->maximum >= index ) {
- the_object = _Objects_Get_local_object( information, index );
+ the_object = information->local_table[ index ];
if ( the_object )
return NULL;
diff --git a/cpukit/score/src/objectget.c b/cpukit/score/src/objectget.c
index 91e44d28cf..01d8683ca7 100644
--- a/cpukit/score/src/objectget.c
+++ b/cpukit/score/src/objectget.c
@@ -53,26 +53,23 @@ Objects_Control *_Objects_Get(
Objects_Control *the_object;
unsigned32 index;
- index = _Objects_Get_index( id );
+ /* index = _Objects_Get_index( id ); */
+ index = (unsigned16) id;
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 );
+ return the_object;
}
_Thread_Enable_dispatch();
*location = OBJECTS_ERROR;
- return( NULL );
+ return NULL;
}
*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;
diff --git a/cpukit/score/src/objectgetbyindex.c b/cpukit/score/src/objectgetbyindex.c
index 6cfc2b98cd..7c7c89c2af 100644
--- a/cpukit/score/src/objectgetbyindex.c
+++ b/cpukit/score/src/objectgetbyindex.c
@@ -54,7 +54,8 @@ Objects_Control *_Objects_Get_by_index(
if ( information->maximum >= index ) {
_Thread_Disable_dispatch();
- if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
+ the_object = information->local_table[ index ];
+ if ( the_object ) {
*location = OBJECTS_LOCAL;
return( the_object );
}