Objects_Information *_Objects_Get_information_id( Objects_Id id ) { return _Objects_Get_information( _Objects_Get_API( id ), _Objects_Get_class( id ) ); }
void epicsThreadGetName (epicsThreadId id, char *name, size_t size) { rtems_id tid = (rtems_id)id; struct taskVar *v; int haveName = 0; if (size <= 0) return; taskVarLock (); for (v=taskVarHead ; v != NULL ; v=v->forw) { if (v->id == tid) { strncpy(name, v->name, size); haveName = 1; break; } } taskVarUnlock (); if (!haveName) { #if (__RTEMS_MAJOR__>4 || \ (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__>8) || \ (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__==8 && __RTEMS_REVISION__>=99)) if (_Objects_Get_name_as_string((rtems_id)id, size, name) != NULL) haveName = 1; #else /* * Try to get the RTEMS task name */ Thread_Control *thr; Objects_Locations l; if ((thr=_Thread_Get(tid, &l)) != NULL) { if (OBJECTS_LOCAL == l) { int length; Objects_Information *oi = _Objects_Get_information(tid); if (oi->name_length >= size) length = size - 1; else length = oi->name_length; if (oi->is_string) strncpy(name, thr->Object.name, length); else _Objects_Copy_name_raw( &thr->Object.name, name, length); name[length] = '\0'; haveName = 1; } _Thread_Enable_dispatch(); } #endif } if (!haveName) snprintf(name, size, "0x%lx", (long)tid); name[size-1] = '\0'; }
void pthread_exit( void *value_ptr ) { Objects_Information *the_information; the_information = _Objects_Get_information( _Thread_Executing->Object.id ); /* This should never happen if _Thread_Get() works right */ assert( the_information ); _Thread_Disable_dispatch(); _Thread_Executing->Wait.return_argument = value_ptr; _Thread_Close( the_information, _Thread_Executing ); _POSIX_Threads_Free( _Thread_Executing ); _Thread_Enable_dispatch(); }
rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { Objects_Information *obj_info; int unallocated; int i; /* * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; }