sp37: Check ISR level of system init

This commit is contained in:
Sebastian Huber
2023-09-12 08:53:24 +02:00
parent 5dc43a04ef
commit 1e7733aca6

View File

@@ -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 );