diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-01-18 13:16:29 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-01-18 13:33:18 +0100 |
commit | 41310c026ca3869adbbe4962474c596ab92b3e5c (patch) | |
tree | 146406a85cb55cfc725f98b22a8f772e7cc3525a /testsuites/sptests/sp37/init.c | |
parent | score: Avoid internal API and use ISR lock (diff) | |
download | rtems-41310c026ca3869adbbe4962474c596ab92b3e5c.tar.bz2 |
score: Improve debug support for ISR locks
Ensure that interrupts are disabled while acquiring an ISR lock.
Diffstat (limited to 'testsuites/sptests/sp37/init.c')
-rw-r--r-- | testsuites/sptests/sp37/init.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c index b050d7f7d1..52c02b09ac 100644 --- a/testsuites/sptests/sp37/init.c +++ b/testsuites/sptests/sp37/init.c @@ -178,6 +178,7 @@ static void test_isr_locks( void ) ISR_lock_Context lock_context; size_t i; const uint8_t *initialized_bytes; + ISR_Level interrupt_level; memset( &container, 0xff, sizeof( container ) ); _ISR_lock_Initialize( &container.lock, "test" ); @@ -203,9 +204,20 @@ static void test_isr_locks( void ) rtems_test_assert( normal_interrupt_level == _ISR_Get_level() ); +#if defined(RTEMS_DEBUG) + _ISR_lock_ISR_disable( &lock_context ); +#endif + interrupt_level = _ISR_Get_level(); _ISR_lock_Acquire( &container.lock, &lock_context ); + rtems_test_assert( interrupt_level == _ISR_Get_level() ); +#if !defined(RTEMS_DEBUG) rtems_test_assert( normal_interrupt_level == _ISR_Get_level() ); +#endif _ISR_lock_Release( &container.lock, &lock_context ); + rtems_test_assert( interrupt_level == _ISR_Get_level() ); +#if defined(RTEMS_DEBUG) + _ISR_lock_ISR_enable( &lock_context ); +#endif rtems_test_assert( normal_interrupt_level == _ISR_Get_level() ); |