[rtems commit] config: Modify CONFIGURE_INTERRUPT_STACK_SIZE
Sebastian Huber
sebh at rtems.org
Thu Oct 25 04:42:57 UTC 2018
Module: rtems
Branch: master
Commit: 24b58072ff1ac5a1691374aa139807bf866bf01a
Changeset: http://git.rtems.org/rtems/commit/?id=24b58072ff1ac5a1691374aa139807bf866bf01a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Oct 24 07:35:51 2018 +0200
config: Modify CONFIGURE_INTERRUPT_STACK_SIZE
Use CPU_STACK_MINIMUM_SIZE instead of CONFIGURE_MINIMUM_TASK_STACK_SIZE
to set the default value.
Close #3480.
---
cpukit/include/rtems/confdefs.h | 2 +-
testsuites/sptests/spconfig01/init.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 2e183c7..8323674 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1166,7 +1166,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#ifdef BSP_INTERRUPT_STACK_SIZE
#define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
#else
- #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
+ #define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE
#endif
#endif
diff --git a/testsuites/sptests/spconfig01/init.c b/testsuites/sptests/spconfig01/init.c
index 6979d2e..7b13d69 100644
--- a/testsuites/sptests/spconfig01/init.c
+++ b/testsuites/sptests/spconfig01/init.c
@@ -12,12 +12,15 @@
* http://www.rtems.com/license/LICENSE.
*/
+#define _GNU_SOURCE
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/stat.h>
#include <errno.h>
+#include <pthread.h>
#include <bsp.h>
@@ -83,13 +86,40 @@ static rtems_status_code app_extra_drivers_init(
return RTEMS_SUCCESSFUL;
}
+static void test_stack_config(void)
+{
+ pthread_attr_t attr;
+ size_t stack_size;
+ int eno;
+
+ rtems_test_assert(
+ rtems_configuration_get_interrupt_stack_size() == CPU_STACK_MINIMUM_SIZE
+ );
+
+ eno = pthread_getattr_np(pthread_self(), &attr);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_attr_getstacksize(&attr, &stack_size);
+ rtems_test_assert(eno == 0);
+ rtems_test_assert(stack_size == 2 * CPU_STACK_MINIMUM_SIZE);
+
+ eno = pthread_attr_destroy(&attr);
+ rtems_test_assert(eno == 0);
+}
+
static void Init(rtems_task_argument arg)
{
checkpoint(3);
+ test_stack_config();
TEST_END();
rtems_test_exit(0);
}
+#ifdef BSP_INTERRUPT_STACK_SIZE
+#warning "BSP_INTERRUPT_STACK_SIZE will be #undef for this test"
+#undef BSP_INTERRUPT_STACK_SIZE
+#endif
+
#ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
#warning "CONFIGURE_BSP_PREREQUISITE_DRIVERS will be #undef for this test"
#undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
@@ -110,6 +140,8 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (2 * CPU_STACK_MINIMUM_SIZE)
+
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
More information about the vc
mailing list