[rtems commit] smptests: Do not use Giant directly

Sebastian Huber sebh at rtems.org
Wed Mar 4 11:05:25 UTC 2015


Module:    rtems
Branch:    master
Commit:    0324410836a62e2c8e5b29aef49f34e0880c1104
Changeset: http://git.rtems.org/rtems/commit/?id=0324410836a62e2c8e5b29aef49f34e0880c1104

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Feb 26 10:26:49 2015 +0100

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.

---

 testsuites/smptests/smpcache01/init.c | 8 ++++----
 testsuites/smptests/smpfatal03/init.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c
index 39808b3..01d6e1e 100644
--- a/testsuites/smptests/smpcache01/init.c
+++ b/testsuites/smptests/smpcache01/init.c
@@ -95,14 +95,14 @@ static void standard_funcs_giant_taken_test( size_t set_size,
     cpu_set_t *cpu_set, SMP_barrier_State *bs )
 {
   if ( rtems_get_current_processor() == 0)
-    _Giant_Acquire();
+    _Thread_Disable_dispatch();
 
   _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
 
   cache_manager_smp_functions( set_size, cpu_set );
 
   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,
@@ -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;
 
   if ( rtems_get_current_processor() == 0)
-    _Giant_Acquire();
+    _Thread_Disable_dispatch();
 
   _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() );
 
   if ( rtems_get_current_processor() == 0)
-    _Giant_Release();
+    _Thread_Enable_dispatch();
 }
 
 static void cmlog(  const char* str )
diff --git a/testsuites/smptests/smpfatal03/init.c b/testsuites/smptests/smpfatal03/init.c
index 6d7a7ec..788b071 100644
--- a/testsuites/smptests/smpfatal03/init.c
+++ b/testsuites/smptests/smpfatal03/init.c
@@ -42,7 +42,7 @@ static void acquire_giant_and_fatal_task(rtems_task_argument arg)
   int i;
 
   for (i = 0; i < 13; ++i) {
-    _Giant_Acquire();
+    _Thread_Disable_dispatch();
   }
 
   _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);
 
-  _Giant_Acquire();
+  _Thread_Disable_dispatch();
 }
 
 static void Init(rtems_task_argument arg)



More information about the vc mailing list