diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-17 15:43:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 07:49:41 +0200 |
commit | dab902d5b2688fe958118299f7d44d1adbf13878 (patch) | |
tree | fa54fcf607d93dd03017f9d0eb1f82ca0f55aca4 /testsuites/smptests/smpcache01 | |
parent | score: Avoid Giant _Objects_Extend_information() (diff) | |
download | rtems-dab902d5b2688fe958118299f7d44d1adbf13878.tar.bz2 |
testsuites: Avoid Giant lock
Replace _Thread_Disable_dispatch() with _Thread_Dispatch_disable().
Replace _Thread_Enable_dispatch() with _Thread_Dispatch_enable().
This is a preparation to remove the Giant lock.
Update #2555.
Diffstat (limited to 'testsuites/smptests/smpcache01')
-rw-r--r-- | testsuites/smptests/smpcache01/init.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c index d8995e8be2..52ee997fa5 100644 --- a/testsuites/smptests/smpcache01/init.c +++ b/testsuites/smptests/smpcache01/init.c @@ -166,19 +166,19 @@ static void call_tests_isr_disabled( size_t set_size, } } -static void call_tests_with_giant_acquired( size_t set_size, +static void call_tests_with_thread_dispatch_disabled( size_t set_size, const cpu_set_t *cpu_set, SMP_barrier_State *bs ) { size_t i; for (i = 0; i < RTEMS_ARRAY_SIZE( test_cases ); ++i) { - if ( rtems_get_current_processor() == 0) - _Thread_Disable_dispatch(); + Per_CPU_Control *cpu_self; + + cpu_self = _Thread_Dispatch_disable(); call_test( set_size, cpu_set, bs, i ); - if ( rtems_get_current_processor() == 0) - _Thread_Enable_dispatch(); + _Thread_Dispatch_enable( cpu_self ); } } @@ -208,10 +208,9 @@ static void all_tests( void ) call_tests_isr_disabled( set_size, cpu_set, &bs ); cmlog( "Done!\n" ); - /* Call test cases with core 0 holding the giant lock */ - cmlog( "Calling test cases with CPU0 holding " - "the giant lock. " ); - call_tests_with_giant_acquired( set_size, cpu_set, &bs ); + /* Call test cases with thread dispatch disabled */ + cmlog( "Calling test cases with thread_dispatch_disabled. "); + call_tests_with_thread_dispatch_disabled( set_size, cpu_set, &bs ); cmlog( "Done!\n"); /* Done. Free up memory. */ |