summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 21:06:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 21:06:31 +0000
commit5250ff39f042c09503b61eb81a2c705e9b06b917 (patch)
treec685bbf9969cc3ec5da6d24b7b353805d6371edb /cpukit/score/inline
parent3235ad9a2cd717df901853ad5220a4aaffae84a9 (diff)
downloadrtems-5250ff39f042c09503b61eb81a2c705e9b06b917.tar.bz2
Moved _Thread_Information -> _RTEMS_tasks_Information.
Added a table of object information control blocks. Modified _Thread_Get so it looks up a thread regardless of which thread management "entity" (manager, internal, etc) actually "owns" it.
Diffstat (limited to 'cpukit/score/inline')
-rw-r--r--cpukit/score/inline/rtems/score/thread.inl29
1 files changed, 23 insertions, 6 deletions
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl
index 35b8eeccfe..2a1049f241 100644
--- a/cpukit/score/inline/rtems/score/thread.inl
+++ b/cpukit/score/inline/rtems/score/thread.inl
@@ -231,6 +231,7 @@ STATIC INLINE boolean _Thread_Is_null (
*
* _Thread_Get
*
+ * NOTE: XXX... This routine may be able to be optimized.
*/
STATIC INLINE Thread_Control *_Thread_Get (
@@ -238,14 +239,30 @@ STATIC INLINE Thread_Control *_Thread_Get (
Objects_Locations *location
)
{
+ Objects_Classes the_class;
+ Objects_Information *information;
+
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- return( _Thread_Executing );
+ _Thread_Disable_dispatch();
+ *location = OBJECTS_LOCAL;
+ return( _Thread_Executing );
}
-
- return (Thread_Control *)
- _Objects_Get( &_Thread_Information, id, location );
+
+ the_class = rtems_get_class( id );
+
+ if ( the_class > OBJECTS_CLASSES_LAST ) {
+ *location = OBJECTS_ERROR;
+ return (Thread_Control *) 0;
+ }
+
+ information = _Objects_Information_table[ the_class ];
+
+ if ( !information || !information->is_thread ) {
+ *location = OBJECTS_ERROR;
+ return (Thread_Control *) 0;
+ }
+
+ return (Thread_Control *) _Objects_Get( information, id, location );
}
#endif