diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-07 12:53:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-11 10:58:09 +0100 |
commit | 28779c70ffebbb2006eb7df01d64180859bb324e (patch) | |
tree | 18a8a77fce926492c090ca2bea21904d743adeb6 /testsuites | |
parent | score: Add local context to SMP lock API (diff) | |
download | rtems-28779c70ffebbb2006eb7df01d64180859bb324e.tar.bz2 |
score: Add function to destroy SMP locks
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/smptests/smplock01/init.c | 12 | ||||
-rw-r--r-- | testsuites/sptests/sp37/init.c | 6 | ||||
-rw-r--r-- | testsuites/sptests/spcache01/init.c | 3 | ||||
-rw-r--r-- | testsuites/sptests/spnsext01/init.c | 1 | ||||
-rw-r--r-- | testsuites/tmtests/tmcontext01/init.c | 4 |
5 files changed, 23 insertions, 3 deletions
diff --git a/testsuites/smptests/smplock01/init.c b/testsuites/smptests/smplock01/init.c index d67d7bc07e..7c536c304c 100644 --- a/testsuites/smptests/smplock01/init.c +++ b/testsuites/smptests/smplock01/init.c @@ -138,15 +138,19 @@ static void test_2_body( ) { unsigned long counter = 0; - SMP_lock_Control lock = SMP_LOCK_INITIALIZER; + SMP_lock_Control lock; SMP_lock_Context lock_context; + _SMP_lock_Initialize(&lock); + while (assert_state(ctx, START_TEST)) { _SMP_lock_Acquire(&lock, &lock_context); _SMP_lock_Release(&lock, &lock_context); ++counter; } + _SMP_lock_Destroy(&lock); + ctx->test_counter[test][cpu_self] = counter; } @@ -159,9 +163,11 @@ static void test_3_body( ) { unsigned long counter = 0; - SMP_lock_Control lock = SMP_LOCK_INITIALIZER; + SMP_lock_Control lock; SMP_lock_Context lock_context; + _SMP_lock_Initialize(&lock); + while (assert_state(ctx, START_TEST)) { _SMP_lock_Acquire(&lock, &lock_context); @@ -172,6 +178,8 @@ static void test_3_body( ++counter; } + _SMP_lock_Destroy(&lock); + ctx->test_counter[test][cpu_self] = counter; } diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c index cd49ae26f8..4a3e08c862 100644 --- a/testsuites/sptests/sp37/init.c +++ b/testsuites/sptests/sp37/init.c @@ -178,6 +178,9 @@ static void test_isr_locks( void ) _ISR_lock_Release( &lock, &lock_context ); rtems_test_assert( normal_interrupt_level == _ISR_Get_level() ); + + _ISR_lock_Destroy( &lock ); + _ISR_lock_Destroy( &initialized ); } static rtems_mode get_interrupt_level( void ) @@ -212,6 +215,9 @@ static void test_interrupt_locks( void ) rtems_interrupt_lock_release_isr( &lock, &lock_context ); rtems_test_assert( normal_interrupt_level == get_interrupt_level() ); + + rtems_interrupt_lock_destroy( &lock ); + rtems_interrupt_lock_destroy( &initialized ); } void test_interrupt_inline(void) diff --git a/testsuites/sptests/spcache01/init.c b/testsuites/sptests/spcache01/init.c index faccbd4084..4c0c3c3f61 100644 --- a/testsuites/sptests/spcache01/init.c +++ b/testsuites/sptests/spcache01/init.c @@ -90,6 +90,7 @@ static void test_data_flush_and_invalidate(void) } rtems_interrupt_lock_release(&lock, &lock_context); + rtems_interrupt_lock_destroy(&lock); printf( "data cache operations by line passed the test (%s cache detected)\n", @@ -364,6 +365,8 @@ static void test_timing(void) d[1], d[2] ); + + rtems_interrupt_lock_destroy(&lock); } static void Init(rtems_task_argument arg) diff --git a/testsuites/sptests/spnsext01/init.c b/testsuites/sptests/spnsext01/init.c index 788ba0b187..b445679fb9 100644 --- a/testsuites/sptests/spnsext01/init.c +++ b/testsuites/sptests/spnsext01/init.c @@ -65,6 +65,7 @@ static rtems_task Init(rtems_task_argument argument) uptime = new_uptime; } rtems_interrupt_lock_release(&lock, &lock_context); + rtems_interrupt_lock_destroy(&lock); puts("*** END OF TEST NANO SECONDS EXTENSION 1 ***"); diff --git a/testsuites/tmtests/tmcontext01/init.c b/testsuites/tmtests/tmcontext01/init.c index 130952b4e8..bd047a2ccf 100644 --- a/testsuites/tmtests/tmcontext01/init.c +++ b/testsuites/tmtests/tmcontext01/init.c @@ -129,7 +129,7 @@ static void sort_t(void) static void test_by_function_level(int fl, bool dirty) { - rtems_interrupt_lock lock = RTEMS_INTERRUPT_LOCK_INITIALIZER; + rtems_interrupt_lock lock; rtems_interrupt_lock_context lock_context; int s; uint64_t min; @@ -138,6 +138,7 @@ static void test_by_function_level(int fl, bool dirty) uint64_t q3; uint64_t max; + rtems_interrupt_lock_initialize(&lock); rtems_interrupt_lock_acquire(&lock, &lock_context); for (s = 0; s < SAMPLES; ++s) { @@ -145,6 +146,7 @@ static void test_by_function_level(int fl, bool dirty) } rtems_interrupt_lock_release(&lock, &lock_context); + rtems_interrupt_lock_destroy(&lock); sort_t(); |