[rtems commit] score: Fix for RTEMS_DEBUG

Sebastian Huber sebh at rtems.org
Tue Mar 22 07:05:43 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 22 07:58:41 2016 +0100

score: Fix for RTEMS_DEBUG

The rtems_extension_create() no longer uses the Giant lock.  Ensure that
we call _User_extensions_Add_set() only in the right context.

Update #2555.

---

 cpukit/score/include/rtems/score/percpu.h | 4 ++--
 cpukit/score/src/userextaddset.c          | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 95c93dd..6b60858 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -521,7 +521,7 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
   do { \
     uint32_t ncpus = _SMP_Get_processor_count(); \
     uint32_t cpu; \
-    _ISR_Disable( isr_cookie ); \
+    _ISR_Disable_without_giant( isr_cookie ); \
     for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { \
       _Per_CPU_Acquire( _Per_CPU_Get_by_index( cpu ) ); \
     } \
@@ -539,7 +539,7 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
     for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { \
       _Per_CPU_Release( _Per_CPU_Get_by_index( cpu ) ); \
     } \
-    _ISR_Enable( isr_cookie ); \
+    _ISR_Enable_without_giant( isr_cookie ); \
   } while ( 0 )
 #else
 #define _Per_CPU_Release_all( isr_cookie ) \
diff --git a/cpukit/score/src/userextaddset.c b/cpukit/score/src/userextaddset.c
index a55dd8c..f34ad00 100644
--- a/cpukit/score/src/userextaddset.c
+++ b/cpukit/score/src/userextaddset.c
@@ -20,13 +20,20 @@
 #endif
 
 #include <rtems/score/userextimpl.h>
+#include <rtems/score/objectimpl.h>
 #include <rtems/score/percpu.h>
+#include <rtems/score/sysstate.h>
 
 void _User_extensions_Add_set(
   User_extensions_Control *the_extension
 )
 {
-  _Chain_Append( &_User_extensions_List, &the_extension->Node );
+  _Assert(
+    _Objects_Allocator_is_owner()
+      || _System_state_Is_before_multitasking( _System_state_Get() )
+  );
+
+  _Chain_Append_unprotected( &_User_extensions_List, &the_extension->Node );
 
   /*
    * If a switch handler is present, append it to the switch chain.




More information about the vc mailing list