summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-09-12 08:53:24 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-09-14 07:59:18 +0200
commit1e7733aca6ce43d8d7c9315a2809736cef30f741 (patch)
tree07488fa714dda1f9d3afbb4503b0a4aadf1c97d1 /testsuites/sptests
parentbuild: Merge regulator build into library item (diff)
downloadrtems-1e7733aca6ce43d8d7c9315a2809736cef30f741.tar.bz2
sp37: Check ISR level of system init
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/sp37/init.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c
index 2ee21b592e..e8af725a75 100644
--- a/testsuites/sptests/sp37/init.c
+++ b/testsuites/sptests/sp37/init.c
@@ -40,6 +40,8 @@
#define CONFIGURE_INIT
#include "system.h"
+#include <rtems/sysinit.h>
+
const char rtems_test_name[] = "SP 37";
/* prototypes */
@@ -67,6 +69,19 @@ rtems_timer_service_routine test_isr_in_progress(
#define TEST_ISR_EVENT RTEMS_EVENT_0
+static uint32_t boot_isr_level;
+
+static void set_boot_isr_level( void )
+{
+ boot_isr_level = _ISR_Get_level();
+}
+
+RTEMS_SYSINIT_ITEM(
+ set_boot_isr_level,
+ RTEMS_SYSINIT_DEVICE_DRIVERS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
typedef struct {
ISR_Level actual_level;
rtems_id master_task_id;
@@ -154,6 +169,9 @@ static void test_isr_level( void )
ISR_Level current = 0;
ISR_Level last_proper_level;
+ /* Interrupts shall be disabled during system initialization */
+ rtems_test_assert( boot_isr_level != 0 );
+
_ISR_Set_level( current );
rtems_test_assert( _ISR_Get_level() == current );