summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sptls01/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-27 08:46:23 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-10-14 07:29:41 +0200
commitb9212e242fd2cb4b7821eea942d414cc84c27006 (patch)
tree713fbe7ec6c7658960b5edcd72c517368b13dced /testsuites/sptests/sptls01/init.c
parentsptls0*: Enable stack checker (diff)
downloadrtems-b9212e242fd2cb4b7821eea942d414cc84c27006.tar.bz2
sptls01: Disable file system and Newlib reentrancy
Update #4560.
Diffstat (limited to '')
-rw-r--r--testsuites/sptests/sptls01/init.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/testsuites/sptests/sptls01/init.c b/testsuites/sptests/sptls01/init.c
index 64860ec9c9..a1c55940d9 100644
--- a/testsuites/sptests/sptls01/init.c
+++ b/testsuites/sptests/sptls01/init.c
@@ -32,6 +32,7 @@
#include <rtems/bspIo.h>
#include <rtems/stackchk.h>
#include <rtems/sysinit.h>
+#include <rtems/score/tls.h>
#include "tmacros.h"
@@ -64,6 +65,24 @@ static void task(rtems_task_argument arg)
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
}
+static void check_tls_size(void)
+{
+ uintptr_t tls_size;
+
+ tls_size = _TLS_Get_size();
+
+ if (tls_size != 1) {
+ printk(
+ "WARNING: The thread-local storage size is %" PRIuPTR ". It should be\n"
+ "exactly one for this test. Check the BSP implementation. The BSP\n"
+ "should not pull in thread-local storage objects such as errno for\n"
+ "this test.\n",
+ tls_size
+ );
+ rtems_test_assert(tls_size == 1);
+ }
+}
+
static void test(void)
{
rtems_id id;
@@ -101,6 +120,7 @@ static void test(void)
static void test_idle_during_system_init(void)
{
+ rtems_print_printer_printk(&rtems_test_printer);
TEST_BEGIN();
check_tls_item(123);
@@ -111,6 +131,7 @@ static void Init(rtems_task_argument arg)
test();
rtems_test_assert(!rtems_stack_checker_is_blown());
+ check_tls_size();
TEST_END();
rtems_test_exit(0);
@@ -123,7 +144,19 @@ RTEMS_SYSINIT_ITEM(
);
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
+
+/*
+ * Avoid a dependency on errno which might be a thread-local object. This test
+ * assumes that no thread-local storage object other than tls_item is present.
+ */
+#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
+
+/*
+ * This test requires full control over the present thread-local objects. In
+ * certain Newlib configurations, the Newlib reentrancy support may add
+ * thread-local objects.
+ */
+#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
#define CONFIGURE_STACK_CHECKER_ENABLED