mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-03 13:27:24 +08:00
config: Bring back RTEMS 4.11 configuration table
This improves API backward compatibility of RTEMS 5.1 to previous versions.
This commit is contained in:
@@ -44,6 +44,67 @@ extern "C" {
|
||||
* + required number of each object type
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Tasks which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_tasks;
|
||||
|
||||
/**
|
||||
* This field indicates whether Classic API notepads are
|
||||
* enabled or disabled.
|
||||
*/
|
||||
bool notepads_enabled;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Timers which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_timers;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Semaphores which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_semaphores;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Message Queues which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_message_queues;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Partitions which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_partitions;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Regions which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_regions;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Dual Ported Memory Areas which are configured for this
|
||||
* application.
|
||||
*/
|
||||
uint32_t maximum_ports;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Rate Monotonic Periods which are configured for this
|
||||
* application.
|
||||
*/
|
||||
uint32_t maximum_periods;
|
||||
|
||||
/**
|
||||
* This field contains the maximum number of Classic API
|
||||
* Barriers which are configured for this application.
|
||||
*/
|
||||
uint32_t maximum_barriers;
|
||||
|
||||
/**
|
||||
* This field contains the number of Classic API Initialization
|
||||
|
||||
@@ -37,6 +37,24 @@ static rtems_api_configuration_table config;
|
||||
const rtems_api_configuration_table *
|
||||
rtems_configuration_get_rtems_api_configuration( void )
|
||||
{
|
||||
/*
|
||||
* Always initialize the configuration table and do not bother with
|
||||
* synchronization issues. This function is not performance critical. The
|
||||
* configuration values are all constants.
|
||||
*/
|
||||
|
||||
config.notepads_enabled = false;
|
||||
config.maximum_tasks = rtems_configuration_get_maximum_tasks();
|
||||
config.maximum_timers = rtems_configuration_get_maximum_timers();
|
||||
config.maximum_semaphores = rtems_configuration_get_maximum_semaphores();
|
||||
config.maximum_message_queues =
|
||||
rtems_configuration_get_maximum_message_queues();
|
||||
config.maximum_partitions = rtems_configuration_get_maximum_partitions();
|
||||
config.maximum_regions = rtems_configuration_get_maximum_regions();
|
||||
config.maximum_ports = rtems_configuration_get_maximum_ports();
|
||||
config.maximum_periods = rtems_configuration_get_maximum_periods();
|
||||
config.maximum_barriers = rtems_configuration_get_maximum_barriers();
|
||||
|
||||
if ( _RTEMS_tasks_User_task_table.entry_point != NULL ) {
|
||||
config.number_of_initialization_tasks = 1;
|
||||
config.User_initialization_tasks_table = &_RTEMS_tasks_User_task_table;
|
||||
|
||||
@@ -905,6 +905,26 @@ static void do_posix_timer_create(void)
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
}
|
||||
|
||||
static void check_config(void)
|
||||
{
|
||||
const rtems_api_configuration_table *config;
|
||||
|
||||
config = rtems_configuration_get_rtems_api_configuration();
|
||||
|
||||
rtems_test_assert(!config->notepads_enabled);
|
||||
rtems_test_assert(config->maximum_tasks == 2);
|
||||
rtems_test_assert(config->maximum_timers == 1);
|
||||
rtems_test_assert(config->maximum_semaphores == 1);
|
||||
rtems_test_assert(config->maximum_message_queues == 1);
|
||||
rtems_test_assert(config->maximum_partitions == 1);
|
||||
rtems_test_assert(config->maximum_regions == 1);
|
||||
rtems_test_assert(config->maximum_ports == 1);
|
||||
rtems_test_assert(config->maximum_periods == 1);
|
||||
rtems_test_assert(config->maximum_barriers == 1);
|
||||
rtems_test_assert(config->number_of_initialization_tasks == 1);
|
||||
rtems_test_assert(config->User_initialization_tasks_table != NULL);
|
||||
}
|
||||
|
||||
static void Init(rtems_task_argument arg)
|
||||
{
|
||||
next_step(INIT_TASK);
|
||||
@@ -923,6 +943,7 @@ static void Init(rtems_task_argument arg)
|
||||
do_posix_sem_open();
|
||||
do_posix_shm_open();
|
||||
do_posix_timer_create();
|
||||
check_config();
|
||||
TEST_END();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user