void _API_Mutex_Allocate(
  API_Mutex_Control **the_mutex
)
{
  API_Mutex_Control *mutex;

  CORE_mutex_Attributes attr =  {
    CORE_MUTEX_NESTING_IS_ERROR,
    false,
    CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
    0
  };

  mutex = (API_Mutex_Control *) _Objects_Allocate( &_API_Mutex_Information );

  _CORE_mutex_Initialize( &mutex->Mutex, &attr, CORE_MUTEX_UNLOCKED );

  _Objects_Open_u32( &_API_Mutex_Information, &mutex->Object, 1 );

  *the_mutex = mutex;
}
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
{
  return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
}
/**
 *  @brief RTEMS_tasks_Allocate
 *
 *  This function allocates a task control block from
 *  the inactive chain of free task control blocks.
 */
RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
{
  return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
}
Beispiel #4
0
Message_queue_Control *_Message_queue_Allocate(void)
{
  return (Message_queue_Control *)
    _Objects_Allocate(&_Message_queue_Information);
}
/**
 *  @brief Timer_Allocate
 *
 *  This function allocates a timer control block from
 *  the inactive chain of free timer control blocks.
 */
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
{
  return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
}
/**
 *  @brief Rate_monotonic_Allocate
 *
 *  This function allocates a period control block from
 *  the inactive chain of free period control blocks.
 */
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
{
  return (Rate_monotonic_Control *)
    _Objects_Allocate( &_Rate_monotonic_Information );
}