summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-06-29 14:37:47 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-04 08:30:42 +0200
commit03e4d1e931cdd6582ccc92b3a4dc883b446b5647 (patch)
treedea1774058ed7d4c209d594ed6ea50aae3f6656d /testsuites/sptests
parentlibtests/crypt01: Avoid stack overflows (diff)
downloadrtems-03e4d1e931cdd6582ccc92b3a4dc883b446b5647.tar.bz2
score: Add _CPU_Use_thread_local_storage()
At some point during system initialization, the idle threads are created. Afterwards, the boot processor basically executes within the context of an idle thread with thread dispatching disabled. On some architectures, the thread-local storage area of the associated thread must be set in dedicated processor registers. Add the new CPU port function to do this: void _CPU_Use_thread_local_storage( const Context_Control *context ) Close #4672.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/sptls01/init.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/testsuites/sptests/sptls01/init.c b/testsuites/sptests/sptls01/init.c
index 5b5d274d3c..efd0fb4c6c 100644
--- a/testsuites/sptests/sptls01/init.c
+++ b/testsuites/sptests/sptls01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2014, 2022 embedded brains GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,8 @@
#include "config.h"
#endif
-#include <stdio.h>
+#include <rtems/bspIo.h>
+#include <rtems/sysinit.h>
#include "tmacros.h"
@@ -45,7 +46,7 @@ static const volatile uint32_t read_only_small = 0x601dc0feUL;
static void check_tls_item(uint32_t expected)
{
- printf("TLS item = %i\n", tls_item);
+ printk("TLS item = %i\n", tls_item);
rtems_test_assert(tls_item == expected);
}
@@ -97,10 +98,15 @@ static void test(void)
check_tls_item(5);
}
-static void Init(rtems_task_argument arg)
+static void test_idle_during_system_init(void)
{
TEST_BEGIN();
+ check_tls_item(123);
+}
+
+static void Init(rtems_task_argument arg)
+{
test();
TEST_END();
@@ -108,6 +114,12 @@ static void Init(rtems_task_argument arg)
rtems_test_exit(0);
}
+RTEMS_SYSINIT_ITEM(
+ test_idle_during_system_init,
+ RTEMS_SYSINIT_IDLE_THREADS,
+ RTEMS_SYSINIT_ORDER_LAST
+);
+
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER