[rtems commit] config: Remove CONFIGURE_HAS_OWN_INIT_TASK_TABLE

Sebastian Huber sebh at rtems.org
Tue Feb 25 11:32:18 UTC 2020


Module:    rtems
Branch:    master
Commit:    6b0873ffdfd59f163dbb3a64b77dd6604701435d
Changeset: http://git.rtems.org/rtems/commit/?id=6b0873ffdfd59f163dbb3a64b77dd6604701435d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb 14 08:40:41 2020 +0100

config: Remove CONFIGURE_HAS_OWN_INIT_TASK_TABLE

The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options.  These two options are probably unused, see also:

  * https://lists.rtems.org/pipermail/users/2019-April/033129.html

  * https://lists.rtems.org/pipermail/users/2019-April/033130.html

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_HAS_OWN_INIT_TASK_TABLE would have required the use of
the undocumented CONFIGURE_INIT_TASK_TABLE and
CONFIGURE_INIT_TASK_TABLE_SIZE configuration options.

Update #3873.

---

 cpukit/include/rtems/confdefs.h     | 23 ++++++-----------------
 testsuites/sptests/sp54/init.c      | 26 ++++++++------------------
 testsuites/sptests/spfatal01/init.c | 33 +++++++++++++--------------------
 testsuites/sptests/spfatal02/init.c | 20 +-------------------
 testsuites/sptests/spfatal04/init.c | 20 --------------------
 testsuites/sptests/spfatal05/init.c | 20 --------------------
 testsuites/sptests/spfatal06/init.c | 24 +-----------------------
 7 files changed, 29 insertions(+), 137 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index a8fb391..b5f8de4 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1290,13 +1290,8 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
  *
  * Default User Initialization Task Table.  This table guarantees that
  * one user initialization table is defined.
- *
- *  WHEN CONFIGURE_HAS_OWN_INIT_TASK_TABLE is defined, the user is
- *  responsible for defining their own table information and setting the
- *  appropriate variables.
  */
-#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
-    !defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
+#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
 
 /**
  * When using the default Classic API Initialization Tasks Table, this is
@@ -1392,13 +1387,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
   RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE)
 
 #else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-
-/*
- * The user application is responsible for defining everything
- * when CONFIGURE_HAS_OWN_INIT_TABLE is defined.
- */
-#else     /* not using standard or providing own Init Task Table */
 
 /*
  * This is the name of the Initialization Task when none is configured.
@@ -1415,8 +1403,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
  */
 #define CONFIGURE_INIT_TASK_STACK_SIZE 0
 
-#endif    /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
-
 #endif
 /**@}*/  /* end of Classic API Initialization Tasks Table */
 
@@ -2792,8 +2778,7 @@ struct _reent *__getreent(void)
  *  then we need to install the code that runs that loop.
  */
 #ifdef CONFIGURE_INIT
-  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \
-      defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
+  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
     RTEMS_SYSINIT_ITEM(
       _RTEMS_tasks_Initialize_user_tasks_body,
       RTEMS_SYSINIT_CLASSIC_USER_TASKS,
@@ -2986,6 +2971,10 @@ struct _reent *__getreent(void)
   #warning "The CONFIGURE_HAS_OWN_FILESYSTEM_TABLE configuration option is obsolete since RTEMS 5.1"
 #endif
 
+#ifdef CONFIGURE_HAS_OWN_INIT_TABLE
+  #warning "The CONFIGURE_HAS_OWN_INIT_TABLE configuration option is obsolete since RTEMS 5.1"
+#endif
+
 #ifdef CONFIGURE_HAS_OWN_MOUNT_TABLE
   #warning "The CONFIGURE_HAS_OWN_MOUNT_TABLE configuration option is obsolete since RTEMS 5.1"
 #endif
diff --git a/testsuites/sptests/sp54/init.c b/testsuites/sptests/sp54/init.c
index 07001e1..71437fa 100644
--- a/testsuites/sptests/sp54/init.c
+++ b/testsuites/sptests/sp54/init.c
@@ -24,9 +24,10 @@ const char rtems_test_name[] = "SP 54";
 
 static void *Init( uintptr_t ignored )
 {
-  rtems_status_code    status;
-  rtems_task_priority  pri;
-  rtems_id             id;
+  rtems_status_code                    status;
+  rtems_task_priority                  pri;
+  rtems_id                             id;
+  const rtems_api_configuration_table *config;
 
   /*
    *  It is possible that since this thread prints and there is no idle
@@ -52,6 +53,10 @@ static void *Init( uintptr_t ignored )
 
   rtems_test_assert( rtems_configuration_get_do_zero_of_workspace() );
 
+  config = rtems_configuration_get_rtems_api_configuration();
+  rtems_test_assert( config->number_of_initialization_tasks == 0 );
+  rtems_test_assert( config->User_initialization_tasks_table == NULL );
+
   TEST_END();
   rtems_test_exit(0);
 }
@@ -68,21 +73,6 @@ static void *Init( uintptr_t ignored )
 #define CONFIGURE_IDLE_TASK_BODY Init
 #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
 
-/*
- *  Another odd case to hit.  Since we use the Init task is Idle task
- *  configuration, we can dummy up the initialization task configuration
- *  to have a non-NULL pointer and 0 tasks.
- */
-
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1
-
-rtems_initialization_tasks_table Initialization_tasks[1] =
-  { { 0, }};
-
-#define CONFIGURE_INIT_TASK_TABLE      Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
-#define CONFIGURE_INIT_TASK_STACK_SIZE 0
-
 #define CONFIGURE_DIRTY_MEMORY
 
 /*
diff --git a/testsuites/sptests/spfatal01/init.c b/testsuites/sptests/spfatal01/init.c
index 95067e7..4f0c008 100644
--- a/testsuites/sptests/spfatal01/init.c
+++ b/testsuites/sptests/spfatal01/init.c
@@ -8,31 +8,24 @@
  * Classic API Init task create failure
  */
 
-/*
- *  Way too much stack space.  Should generate a fatal error
- *  on the init task create.
- */
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-#define CONFIGURE_INIT_TASK_STACK_SIZE 0
-rtems_initialization_tasks_table Initialization_tasks[] = {
-  { rtems_build_name('I', 'N', 'I', ' '),
-    32UL * 1024UL,
-    1,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    Init,
-    RTEMS_DEFAULT_MODES,
-    0
-  }
-};
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
 #define FATAL_ERROR_TEST_NAME            "1"
 #define FATAL_ERROR_DESCRIPTION          "Classic API Init task create failure"
 #define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
 #define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED
 
+static void *stack_allocator(size_t unused)
+{
+  return NULL;
+}
+
+static void stack_deallocator(void *unused)
+{
+}
+
+#define CONFIGURE_TASK_STACK_ALLOCATOR stack_allocator
+
+#define CONFIGURE_TASK_STACK_DEALLOCATOR stack_deallocator
+
 static void force_error(void)
 {
 /*
diff --git a/testsuites/sptests/spfatal02/init.c b/testsuites/sptests/spfatal02/init.c
index e0f6a97..2700b4d 100644
--- a/testsuites/sptests/spfatal02/init.c
+++ b/testsuites/sptests/spfatal02/init.c
@@ -8,25 +8,7 @@
  * Classic API Init task create failure
  */
 
-/*
- *  Way too much stack space.  Should generate a fatal error
- *  on the init task create.
- */
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-#define CONFIGURE_INIT_TASK_STACK_SIZE   RTEMS_MINIMUM_STACK_SIZE
-rtems_initialization_tasks_table Initialization_tasks[] = {
-  { rtems_build_name('I', 'N', 'I', ' '),
-    RTEMS_MINIMUM_STACK_SIZE,
-    1,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    NULL,
-    RTEMS_DEFAULT_MODES,
-    0
-  }
-};
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
+#define CONFIGURE_INIT_TASK_ENTRY_POINT NULL
 
 #define FATAL_ERROR_TEST_NAME            "2"
 #define FATAL_ERROR_DESCRIPTION          "Classic API Init task start failure"
diff --git a/testsuites/sptests/spfatal04/init.c b/testsuites/sptests/spfatal04/init.c
index cfbad5d..89a4be8 100644
--- a/testsuites/sptests/spfatal04/init.c
+++ b/testsuites/sptests/spfatal04/init.c
@@ -8,26 +8,6 @@
  * Classic API Init task create failure
  */
 
-/*
- *  Way too much stack space.  Should generate a fatal error
- *  on the init task create.
- */
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-#define CONFIGURE_INIT_TASK_STACK_SIZE   RTEMS_MINIMUM_STACK_SIZE
-rtems_initialization_tasks_table Initialization_tasks[] = {
-  { rtems_build_name('I', 'N', 'I', ' '),
-    RTEMS_MINIMUM_STACK_SIZE,
-    1,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    Init,
-    RTEMS_DEFAULT_MODES,
-    0
-  }
-};
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
 #define FATAL_ERROR_TEST_NAME            "4"
 #define FATAL_ERROR_DESCRIPTION \
         "Classic API call rtems_fatal_error_occurred"
diff --git a/testsuites/sptests/spfatal05/init.c b/testsuites/sptests/spfatal05/init.c
index b041116..d17077c 100644
--- a/testsuites/sptests/spfatal05/init.c
+++ b/testsuites/sptests/spfatal05/init.c
@@ -15,26 +15,6 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-/*
- *  Way too much stack space.  Should generate a fatal error
- *  on the init task create.
- */
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-#define CONFIGURE_INIT_TASK_STACK_SIZE   RTEMS_MINIMUM_STACK_SIZE
-rtems_initialization_tasks_table Initialization_tasks[] = {
-  { rtems_build_name('I', 'N', 'I', ' '),
-    RTEMS_MINIMUM_STACK_SIZE,
-    1,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    Init,
-    RTEMS_DEFAULT_MODES,
-    0
-  }
-};
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
 #define SPFATAL_TEST_CASE_EXTRA_TASKS 1
 
 #define FATAL_ERROR_TEST_NAME            "5"
diff --git a/testsuites/sptests/spfatal06/init.c b/testsuites/sptests/spfatal06/init.c
index 842931a..cef38f5 100644
--- a/testsuites/sptests/spfatal06/init.c
+++ b/testsuites/sptests/spfatal06/init.c
@@ -15,39 +15,17 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-/*
- *  Way too much stack space.  Should generate a fatal error
- *  on the init task create.
- */
-#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-#define CONFIGURE_INIT_TASK_STACK_SIZE   RTEMS_MINIMUM_STACK_SIZE
-rtems_initialization_tasks_table Initialization_tasks[] = {
-  { rtems_build_name('I', 'N', 'I', ' '),
-    RTEMS_MINIMUM_STACK_SIZE,
-    1,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    Init,
-    RTEMS_DEFAULT_MODES,
-    0
-  }
-};
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
 #define FATAL_ERROR_TEST_NAME            "6"
 #define FATAL_ERROR_DESCRIPTION \
         "Core initialize with invalid stack hook"
 #define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
 #define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_BAD_STACK_HOOK
 
-void *New_stack_allocate_hook(size_t unused);
-
 #define CONFIGURE_TASK_STACK_ALLOCATOR New_stack_allocate_hook
 
 #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL
 
-void *New_stack_allocate_hook(size_t unused)
+static void *New_stack_allocate_hook(size_t unused)
 {
   return NULL;
 }



More information about the vc mailing list