summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-24 07:35:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-24 10:19:14 +0200
commit24b58072ff1ac5a1691374aa139807bf866bf01a (patch)
treead3626f0b342122c3904753dc95306074b311d74 /testsuites/sptests
parentposix: Provide simple thread functions by default (diff)
downloadrtems-24b58072ff1ac5a1691374aa139807bf866bf01a.tar.bz2
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.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/spconfig01/init.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuites/sptests/spconfig01/init.c b/testsuites/sptests/spconfig01/init.c
index 6979d2eafd..7b13d69122 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