diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-05 10:07:00 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-05 13:45:37 +0200 |
commit | da831d06fddb67a9bd6abce88f2bbee9e3122810 (patch) | |
tree | a6940da96d7abb324deaf58c19234ac96faecd45 | |
parent | smptests/smpswitchextension01: New test (diff) | |
download | rtems-da831d06fddb67a9bd6abce88f2bbee9e3122810.tar.bz2 |
sptests/sp37: Add ISR set/get level tests
-rw-r--r-- | testsuites/sptests/sp37/init.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c index 4ffebbb8da..a12aa771bf 100644 --- a/testsuites/sptests/sp37/init.c +++ b/testsuites/sptests/sp37/init.c @@ -44,6 +44,36 @@ rtems_timer_service_routine test_isr_in_progress( /* test bodies */ +static void test_isr_level( void ) +{ + ISR_Level mask = CPU_MODES_INTERRUPT_MASK; + ISR_Level normal = _ISR_Get_level(); + ISR_Level current = 0; + + _ISR_Set_level( current ); + rtems_test_assert( _ISR_Get_level() == current ); + + for ( current = current + 1 ; current <= mask ; ++current ) { + ISR_Level actual; + + _ISR_Set_level( current ); + + actual = _ISR_Get_level(); + rtems_test_assert( actual == current || actual == ( current - 1 ) ); + + if ( _ISR_Get_level() != current ) { + break; + } + } + + for ( current = current + 1 ; current <= mask ; ++current ) { + _ISR_Set_level( current ); + rtems_test_assert( _ISR_Get_level() == current ); + } + + _ISR_Set_level( normal ); +} + static void test_isr_locks( void ) { ISR_Level normal_interrupt_level = _ISR_Get_level(); @@ -253,6 +283,7 @@ rtems_task Init( puts( "\n\n*** TEST 37 ***" ); + test_isr_level(); test_isr_locks(); test_interrupt_locks(); |