示例#1
0
文件: mqueue.c 项目: epicsdeb/rtems
void _POSIX_Message_queue_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_Message_queue_Information, /* object information table */
    OBJECTS_POSIX_API,                 /* object API */
    OBJECTS_POSIX_MESSAGE_QUEUES,      /* object class */
    Configuration_POSIX_API.maximum_message_queues,
                                /* maximum objects of this class */
    sizeof( POSIX_Message_queue_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX             /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );
  _Objects_Initialize_information(
    &_POSIX_Message_queue_Information_fds,
    OBJECTS_POSIX_API,
    OBJECTS_POSIX_MESSAGE_QUEUE_FDS,
    Configuration_POSIX_API.maximum_message_queue_descriptors,
    sizeof( POSIX_Message_queue_Control_fd ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    NAME_MAX                    /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );
}
示例#2
0
文件: init.c 项目: chch1028/rtems
rtems_task Init(
  rtems_task_argument ignored
)
{
  Objects_Name_or_id_lookup_errors namerc;
  Objects_Information              TestClass;
  Objects_Id                       id;
  char                             name[64];
  bool                             bc;

  puts( "\n\n*** POSIX OBJECT TEST 1 ***" );

  /* very fake object class to test with */
  _Objects_Initialize_information(
    &TestClass,
    1,           /* the_api */
    4,           /* the_class */
    0,           /* maximum */
    4,           /* size */
    true,        /* is_string */
    10           /* maximum_name_length */
    #if defined(RTEMS_MULTIPROCESSING)
      ,
      false,       /* supports_global */
      NULL         /* Objects_Thread_queue_Extract_callout extract */
    #endif
  );

  puts( "INIT - _Objects_Name_to_id_string - NULL name" );
  namerc = _Objects_Name_to_id_string( &TestClass, NULL, &id );
  if ( namerc != OBJECTS_INVALID_NAME ) {
    printf( "ERROR - Status = %d\n", namerc );
    rtems_test_exit(0);
  }

  puts( "INIT - _Objects_Name_to_id_string - NULL ID" );
  namerc = _Objects_Name_to_id_string( &TestClass, name, NULL );
  if ( namerc != OBJECTS_INVALID_ADDRESS ) {
    printf( "ERROR - Status = %d\n", namerc );
    rtems_test_exit(0);
  }

  puts( "INIT - _Objects_Name_to_id_string - name of non-existent object" );
  strcpy( name, "NOT FOUND" );
  namerc = _Objects_Name_to_id_string( &TestClass, name, &id );
  if ( namerc != OBJECTS_INVALID_NAME ) {
    printf( "ERROR - Status = %d\n", namerc );
    rtems_test_exit(0);
  }

  /* out of memory error ONLY when POSIX is enabled */
  puts( "INIT - _Objects_Set_name fails - out of memory" );
  rtems_workspace_greedy_allocate( NULL, 0 );

  bc = _Objects_Set_name( &TestClass, &_Thread_Get_executing()->Object, name );
  rtems_test_assert( bc == false );

  puts( "*** END OF POSIX OBJECT TEST 1 ***" );
  rtems_test_exit(0);
}
示例#3
0
文件: thread.c 项目: Dipupo/rtems
void _Thread_Initialize_information(
  Thread_Information  *information,
  Objects_APIs         the_api,
  uint16_t             the_class,
  uint32_t             maximum,
  bool                 is_string,
  uint32_t             maximum_name_length
)
{
  _Objects_Initialize_information(
    &information->Objects,
    the_api,
    the_class,
    maximum,
    _Thread_Control_size,
    is_string,
    maximum_name_length,
    NULL
  );

  _Freechain_Initialize(
    &information->Free_thread_queue_heads,
    _Workspace_Allocate_or_fatal_error,
    _Objects_Maximum_per_allocation( maximum ),
    THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count )
  );
}
示例#4
0
文件: vmempool.c 项目: epicsdeb/rtems
void _ITRON_Variable_memory_pool_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_ITRON_Variable_memory_pool_Information, /* object information table */
    OBJECTS_ITRON_API,                        /* object API */
    OBJECTS_ITRON_VARIABLE_MEMORY_POOLS,      /* object class */
    Configuration_ITRON_API.maximum_memory_pools,
                                /* maximum objects of this class */
    sizeof( ITRON_Variable_memory_pool_Control ),
                                /* size of this object's control block */
    false,                      /* true if names for this object are strings */
    ITRON_MAXIMUM_NAME_LENGTH   /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );

  /*
   *  Register the MP Process Packet routine.
   *
   *  NOTE: No MP Support YET in RTEMS ITRON implementation.
   */

}
示例#5
0
文件: key.c 项目: Fyleo/rtems
/**
 * @brief This routine performs the initialization necessary for this manager.
 */
void _POSIX_Key_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_Keys_Information,   /* object information table */
    OBJECTS_POSIX_API,          /* object API */
    OBJECTS_POSIX_KEYS,         /* object class */
    Configuration.maximum_keys,
                                /* maximum objects of this class */
    sizeof( POSIX_Keys_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX             /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );

  _RBTree_Initialize_empty(
      &_POSIX_Keys_Key_value_lookup_tree,
      _POSIX_Keys_Key_value_lookup_tree_compare_function,
      true
  );

  _POSIX_Keys_Initialize_keypool();
}
示例#6
0
void _Timer_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_Timer_Information,       /* object information table */
    OBJECTS_CLASSIC_API,       /* object API */
    OBJECTS_RTEMS_TIMERS,      /* object class */
    Configuration_RTEMS_API.maximum_timers ,
                               /* maximum objects of this class */
    sizeof( Timer_Control ),   /* size of this object's control block */
    false,                     /* true if the name is a string */
    RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                     /* true if this is a global object class */
    NULL                       /* Proxy extraction support callout */
#endif
  );

  /*
   *  Initialize the pointer to the default timer server control block to NULL
   *  indicating that task-based timer support is not initialized.
   */

  _Timer_server = NULL;
}
示例#7
0
文件: msg.c 项目: AoLaD/rtems
static void _Message_queue_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_Message_queue_Information,  /* object information table */
    OBJECTS_CLASSIC_API,          /* object API */
    OBJECTS_RTEMS_MESSAGE_QUEUES, /* object class */
    Configuration_RTEMS_API.maximum_message_queues,
                                  /* maximum objects of this class */
    sizeof( Message_queue_Control ),
                                  /* size of this object's control block */
    false,                        /* true if names of this object are strings */
    RTEMS_MAXIMUM_NAME_LENGTH,    /* maximum length of each object's name */
    _Message_queue_MP_Send_extract_proxy
                                  /* Proxy extraction support callout */
  );

  /*
   *  Register the MP Process Packet routine.
   */

#if defined(RTEMS_MULTIPROCESSING)
  _MPCI_Register_packet_processor(
    MP_PACKET_MESSAGE_QUEUE,
    _Message_queue_MP_Process_packet
  );
#endif

}
void _Partition_Manager_initialization(void)
{
    _Objects_Initialize_information(
        &_Partition_Information,     /* object information table */
        OBJECTS_CLASSIC_API,         /* object API */
        OBJECTS_RTEMS_PARTITIONS,    /* object class */
        Configuration_RTEMS_API.maximum_partitions,
        /* maximum objects of this class */
        sizeof( Partition_Control ), /* size of this object's control block */
        false,                       /* true if the name is a string */
        RTEMS_MAXIMUM_NAME_LENGTH    /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
        ,
        true,                        /* true if this is a global object class */
        _Partition_MP_Send_extract_proxy  /* Proxy extraction support callout */
#endif
    );

    /*
     *  Register the MP Process Packet routine.
     */

#if defined(RTEMS_MULTIPROCESSING)
    _MPCI_Register_packet_processor(
        MP_PACKET_PARTITION,
        _Partition_MP_Process_packet
    );
#endif

}
示例#9
0
文件: thread.c 项目: ketul93/rtems
void _Thread_Initialize_information(
  Thread_Information  *information,
  Objects_APIs         the_api,
  uint16_t             the_class,
  uint32_t             maximum,
  bool                 is_string,
  uint32_t             maximum_name_length
#if defined(RTEMS_MULTIPROCESSING)
  ,
  bool                 supports_global
#endif
)
{
  _Objects_Initialize_information(
    &information->Objects,
    the_api,
    the_class,
    maximum,
    _Thread_Control_size,
    is_string,
    maximum_name_length
    #if defined(RTEMS_MULTIPROCESSING)
      ,
      supports_global,
      NULL
    #endif
  );

  _Freechain_Initialize(
    &information->Free_thread_queue_heads,
    _Workspace_Allocate_or_fatal_error,
    _Objects_Maximum_per_allocation( maximum ),
    sizeof( Thread_queue_Heads )
  );
}
示例#10
0
void _ITRON_Task_Manager_initialization(void)
{

  _Objects_Initialize_information(
    &_ITRON_Task_Information,   /* object information table */
    OBJECTS_ITRON_API,          /* object API */
    OBJECTS_ITRON_TASKS,        /* object class */
    Configuration_ITRON_API.maximum_tasks,
                                /* maximum objects of this class */
    sizeof( Thread_Control ),   /* size of this object's control block */
    false,                      /* true if names for this object are strings */
    ITRON_MAXIMUM_NAME_LENGTH   /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );

  /*
   *  Until ITRON needs this, do not even declare it.
   */
  #if 0
    /*
     *  Add all the extensions for this API
     */
    _User_extensions_Add_API_set( &_ITRON_Task_User_extensions );
  #endif

  _API_extensions_Add( &_ITRON_Task_API_extensions );

}
示例#11
0
文件: pbarrier.c 项目: AoLaD/rtems
/**
 *  @brief _POSIX_Barrier_Manager_initialization
 */
static void _POSIX_Barrier_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_Barrier_Information,    /* object information table */
    OBJECTS_POSIX_API,              /* object API */
    OBJECTS_POSIX_BARRIERS,         /* object class */
    Configuration_POSIX_API.maximum_barriers,
				    /* maximum objects of this class */
    sizeof( POSIX_Barrier_Control ),/* size of this object's control block */
    true,                           /* true if the name is a string */
    _POSIX_PATH_MAX,                /* maximum length of each object's name */
    NULL                            /* Proxy extraction support callout */
  );
}
示例#12
0
文件: semaphore.c 项目: AoLaD/rtems
static void _POSIX_Semaphore_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_Semaphore_Information, /* object information table */
    OBJECTS_POSIX_API,          /* object API */
    OBJECTS_POSIX_SEMAPHORES,   /* object class */
    Configuration_POSIX_API.maximum_semaphores,
                                /* maximum objects of this class */
    sizeof( POSIX_Semaphore_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX,            /* maximum length of each object's name */
    NULL                        /* Proxy extraction support callout */
  );
}
示例#13
0
文件: apimutex.c 项目: Dipupo/rtems
void _API_Mutex_Initialization(
  uint32_t maximum_mutexes
)
{
  _Objects_Initialize_information(
    &_API_Mutex_Information,     /* object information table */
    OBJECTS_INTERNAL_API,        /* object API */
    OBJECTS_INTERNAL_MUTEXES,    /* object class */
    maximum_mutexes,             /* maximum objects of this class */
    sizeof( API_Mutex_Control ), /* size of this object's control block */
    false,                       /* true if the name is a string */
    0,                           /* maximum length of an object name */
    NULL                         /* Proxy extraction support callout */
  );
}
示例#14
0
void _Extension_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_Extension_Information,
    OBJECTS_CLASSIC_API,                 /* object API */
    OBJECTS_RTEMS_EXTENSIONS,
    rtems_configuration_get_maximum_extensions(),
    sizeof( Extension_Control ),
    false,                     /* true if the name is a string */
    RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                     /* true if this is a global object class */
    NULL                       /* Proxy extraction support callout */
#endif
  );
}
示例#15
0
文件: mutex.c 项目: AoLaD/rtems
static void _POSIX_Mutex_Manager_initialization(void)
{
  /*
   * Initialize the POSIX mutex object class information structure.
   */
  _Objects_Initialize_information(
    &_POSIX_Mutex_Information,  /* object information table */
    OBJECTS_POSIX_API,          /* object API */
    OBJECTS_POSIX_MUTEXES,      /* object class */
    Configuration_POSIX_API.maximum_mutexes,
                                /* maximum objects of this class */
    sizeof( POSIX_Mutex_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX,            /* maximum length of each object's name */
    NULL                        /* Proxy extraction support callout */
  );
}
示例#16
0
void _POSIX_RWLock_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_RWLock_Information,     /* object information table */
    OBJECTS_POSIX_API,              /* object API */
    OBJECTS_POSIX_SPINLOCKS,        /* object class */
    Configuration_POSIX_API.maximum_rwlocks,
                                    /* maximum objects of this class */
    sizeof( POSIX_RWLock_Control ), /* size of this object's control block */
    true,                           /* true if the name is a string */
    _POSIX_PATH_MAX                 /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                         /* true if this is a global object class */
    NULL                           /* Proxy extraction support callout */
#endif
  );
}
示例#17
0
文件: barrier.c 项目: epicsdeb/rtems
void _Barrier_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_Barrier_Information,         /* object information table */
    OBJECTS_CLASSIC_API,           /* object API */
    OBJECTS_RTEMS_BARRIERS,        /* object class */
    Configuration_RTEMS_API.maximum_barriers,
                                   /* maximum objects of this class */
    sizeof( Barrier_Control ),     /* size of this object's control block */
    false,                         /* true if the name is a string */
    RTEMS_MAXIMUM_NAME_LENGTH      /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                         /* true if this is a global object class */
    NULL                           /* Proxy extraction support callout */
#endif
  );
}
示例#18
0
文件: cond.c 项目: atixing/rtems
void _POSIX_Condition_variables_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_POSIX_Condition_variables_Information, /* object information table */
    OBJECTS_POSIX_API,                       /* object API */
    OBJECTS_POSIX_CONDITION_VARIABLES,       /* object class */
    Configuration_POSIX_API.maximum_condition_variables,
                                /* maximum objects of this class */
    sizeof( POSIX_Condition_variables_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX             /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );
}
示例#19
0
void _RTEMS_tasks_Manager_initialization(void)
{
  _Objects_Initialize_information(
    &_RTEMS_tasks_Information, /* object information table */
    OBJECTS_CLASSIC_API,       /* object API */
    OBJECTS_RTEMS_TASKS,       /* object class */
    Configuration_RTEMS_API.maximum_tasks,
                               /* maximum objects of this class */
    sizeof( Thread_Control ),  /* size of this object's control block */
    false,                     /* true if the name is a string */
    RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    true,                      /* true if this is a global object class */
    NULL                       /* Proxy extraction support callout */
#endif
  );

  /*
   *  Add all the extensions for this API
   */

  _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );

  _API_extensions_Add( &_RTEMS_tasks_API_extensions );

  /*
   *  Register the MP Process Packet routine.
   */

#if defined(RTEMS_MULTIPROCESSING)
  _MPCI_Register_packet_processor(
    MP_PACKET_TASKS,
    _RTEMS_tasks_MP_Process_packet
  );
#endif

}
示例#20
0
文件: mutex.c 项目: epicsdeb/rtems
void _POSIX_Mutex_Manager_initialization(void)
{
  pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes;

  /*
   * Since the maximum priority is run-time configured, this
   * structure cannot be initialized statically.
   */
  default_attr->is_initialized = true;
  default_attr->process_shared = PTHREAD_PROCESS_PRIVATE;
  default_attr->prio_ceiling   = POSIX_SCHEDULER_MAXIMUM_PRIORITY;
  default_attr->protocol       = PTHREAD_PRIO_NONE;
  default_attr->recursive      = false;
  #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
    default_attr->type         = PTHREAD_MUTEX_DEFAULT;
  #endif

  /*
   * Initialize the POSIX mutex object class information structure.
   */
  _Objects_Initialize_information(
    &_POSIX_Mutex_Information,  /* object information table */
    OBJECTS_POSIX_API,          /* object API */
    OBJECTS_POSIX_MUTEXES,      /* object class */
    Configuration_POSIX_API.maximum_mutexes,
                                /* maximum objects of this class */
    sizeof( POSIX_Mutex_Control ),
                                /* size of this object's control block */
    true,                       /* true if names for this object are strings */
    _POSIX_PATH_MAX             /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
    ,
    false,                      /* true if this is a global object class */
    NULL                        /* Proxy extraction support callout */
#endif
  );
}