score: Add function to destroy SMP locks

This commit is contained in:
Sebastian Huber
2014-03-07 12:53:41 +01:00
parent d50acdbb6c
commit 28779c70ff
9 changed files with 78 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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