[rtems commit] score: Fix debug thread queue context init

Sebastian Huber sebh at rtems.org
Fri Dec 2 09:36:56 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec  1 22:24:02 2016 +0100

score: Fix debug thread queue context init

On ARM Thumb we may have function addresses ending with 0x7f, if we are
lucky.

---

 cpukit/score/include/rtems/score/threadqimpl.h | 2 ++
 cpukit/score/src/threadqenqueue.c              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h
index 760c83c..fc907d3 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -91,6 +91,8 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_initialize(
 #if defined(RTEMS_SMP)
   _Chain_Initialize_node( &queue_context->Lock_context.Wait.Gate.Node );
 #endif
+  queue_context->enqueue_callout = NULL;
+  queue_context->deadlock_callout = NULL;
 #else
   (void) queue_context;
 #endif
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 4d71ba7..cea1886 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -420,7 +420,7 @@ void _Thread_queue_Enqueue(
   Per_CPU_Control *cpu_self;
   bool             success;
 
-  _Assert( (uint8_t) (uintptr_t) queue_context->enqueue_callout != 0x7f );
+  _Assert( queue_context->enqueue_callout != NULL );
   _Assert( (uint8_t) queue_context->timeout_discipline != 0x7f );
 
 #if defined(RTEMS_MULTIPROCESSING)
@@ -436,7 +436,7 @@ void _Thread_queue_Enqueue(
     _Thread_Wait_restore_default( the_thread );
     _Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );
     _Thread_Wait_tranquilize( the_thread );
-    _Assert( (uint8_t) (uintptr_t) queue_context->deadlock_callout != 0x7f );
+    _Assert( queue_context->deadlock_callout != NULL );
     ( *queue_context->deadlock_callout )( the_thread );
     return;
   }




More information about the vc mailing list