forked from Imagelibrary/rtems
smptests: Do not use Giant directly
This ensures that thread dispatching is disabled. A Giant acquire/release pair must take place in the same processor.
This commit is contained in:
@@ -95,14 +95,14 @@ static void standard_funcs_giant_taken_test( size_t set_size,
|
|||||||
cpu_set_t *cpu_set, SMP_barrier_State *bs )
|
cpu_set_t *cpu_set, SMP_barrier_State *bs )
|
||||||
{
|
{
|
||||||
if ( rtems_get_current_processor() == 0)
|
if ( rtems_get_current_processor() == 0)
|
||||||
_Giant_Acquire();
|
_Thread_Disable_dispatch();
|
||||||
|
|
||||||
_SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
|
_SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
|
||||||
|
|
||||||
cache_manager_smp_functions( set_size, cpu_set );
|
cache_manager_smp_functions( set_size, cpu_set );
|
||||||
|
|
||||||
if ( rtems_get_current_processor() == 0)
|
if ( rtems_get_current_processor() == 0)
|
||||||
_Giant_Release();
|
_Thread_Enable_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_func_test( size_t set_size, cpu_set_t *cpu_set,
|
static void test_func_test( size_t set_size, cpu_set_t *cpu_set,
|
||||||
@@ -145,7 +145,7 @@ static void test_func_giant_taken_test( size_t set_size, cpu_set_t *cpu_set,
|
|||||||
ctx.count[rtems_get_current_processor()] = 0;
|
ctx.count[rtems_get_current_processor()] = 0;
|
||||||
|
|
||||||
if ( rtems_get_current_processor() == 0)
|
if ( rtems_get_current_processor() == 0)
|
||||||
_Giant_Acquire();
|
_Thread_Disable_dispatch();
|
||||||
|
|
||||||
_SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
|
_SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ static void test_func_giant_taken_test( size_t set_size, cpu_set_t *cpu_set,
|
|||||||
rtems_get_processor_count() );
|
rtems_get_processor_count() );
|
||||||
|
|
||||||
if ( rtems_get_current_processor() == 0)
|
if ( rtems_get_current_processor() == 0)
|
||||||
_Giant_Release();
|
_Thread_Enable_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cmlog( const char* str )
|
static void cmlog( const char* str )
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static void acquire_giant_and_fatal_task(rtems_task_argument arg)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 13; ++i) {
|
for (i = 0; i < 13; ++i) {
|
||||||
_Giant_Acquire();
|
_Thread_Disable_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
_SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
|
_SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
|
||||||
@@ -62,7 +62,7 @@ static void wait_for_giant(void)
|
|||||||
|
|
||||||
_SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
|
_SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
|
||||||
|
|
||||||
_Giant_Acquire();
|
_Thread_Disable_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Init(rtems_task_argument arg)
|
static void Init(rtems_task_argument arg)
|
||||||
|
|||||||
Reference in New Issue
Block a user