summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-08 08:44:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-08 09:34:29 +0200
commitaaaf9610db1a3cb0b01b86dc1a4f1e6b12f43126 (patch)
treec9ba25cf3c9eda0866a762c1f408783e3528fd06 /cpukit/score/src
parentposix: Fix for RTEMS_DEBUG (diff)
downloadrtems-aaaf9610db1a3cb0b01b86dc1a4f1e6b12f43126.tar.bz2
score: Add debug support to red-black trees
This helps to detect double insert and extract errors.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/rbtreeextract.c3
-rw-r--r--cpukit/score/src/scheduleredfnodeinit.c1
-rw-r--r--cpukit/score/src/threadinitialize.c1
-rw-r--r--cpukit/score/src/threadmp.c1
-rw-r--r--cpukit/score/src/threadqenqueue.c1
-rw-r--r--cpukit/score/src/threadqops.c1
-rw-r--r--cpukit/score/src/watchdoginsert.c1
7 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/score/src/rbtreeextract.c b/cpukit/score/src/rbtreeextract.c
index 4d8a8f8eed..3905f64900 100644
--- a/cpukit/score/src/rbtreeextract.c
+++ b/cpukit/score/src/rbtreeextract.c
@@ -22,4 +22,7 @@ void _RBTree_Extract(
)
{
RB_REMOVE( RBTree_Control, the_rbtree, the_node );
+#if defined(RTEMS_DEBUG)
+ _RBTree_Set_off_tree( the_node );
+#endif
}
diff --git a/cpukit/score/src/scheduleredfnodeinit.c b/cpukit/score/src/scheduleredfnodeinit.c
index bde25c18d7..d290bd74fd 100644
--- a/cpukit/score/src/scheduleredfnodeinit.c
+++ b/cpukit/score/src/scheduleredfnodeinit.c
@@ -35,4 +35,5 @@ void _Scheduler_EDF_Node_initialize(
the_node = _Scheduler_EDF_Node_downcast( node );
the_node->thread = the_thread;
+ _RBTree_Initialize_node( &the_node->Node );
}
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index b5fef590fc..8b5d9431e5 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -187,6 +187,7 @@ bool _Thread_Initialize(
"Thread Wait Default Lock"
);
_Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
+ _RBTree_Initialize_node( &the_thread->Wait.Link.Registry_node );
_SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" );
#endif
diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c
index a991d03760..f5253560a6 100644
--- a/cpukit/score/src/threadmp.c
+++ b/cpukit/score/src/threadmp.c
@@ -72,6 +72,7 @@ void _Thread_MP_Handler_initialization (
proxy = (Thread_Proxy_control *) ( proxies + i * proxy_size );
_Thread_Timer_initialize( &proxy->Timer, _Per_CPU_Get_by_index( 0 ) );
+ _RBTree_Initialize_node( &proxy->Active );
proxy->Wait.spare_heads = &proxy->Thread_queue_heads[ 0 ];
_Thread_queue_Heads_initialize( proxy->Wait.spare_heads );
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 54d3a42d9a..1897c6346f 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -251,6 +251,7 @@ static bool _Thread_queue_Path_acquire(
return false;
}
+ _RBTree_Initialize_node( &path->Start.Registry_node );
_Chain_Initialize_node( &path->Start.Path_node );
_Thread_queue_Context_initialize( &path->Start.Queue_context );
link = &path->Start;
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
index d6e42fda8f..df7054f0c8 100644
--- a/cpukit/score/src/threadqops.c
+++ b/cpukit/score/src/threadqops.c
@@ -242,6 +242,7 @@ static void _Thread_queue_Priority_do_enqueue(
#endif
current_priority = the_thread->current_priority;
+ _RBTree_Initialize_node( &the_thread->Wait.Node.RBTree );
_RBTree_Insert_inline(
&priority_queue->Queue,
&the_thread->Wait.Node.RBTree,
diff --git a/cpukit/score/src/watchdoginsert.c b/cpukit/score/src/watchdoginsert.c
index 22fc7a5f76..b9f5eb88fb 100644
--- a/cpukit/score/src/watchdoginsert.c
+++ b/cpukit/score/src/watchdoginsert.c
@@ -60,6 +60,7 @@ void _Watchdog_Insert(
}
header->first = new_first;
+ _RBTree_Initialize_node( &the_watchdog->Node.RBTree );
_RBTree_Add_child( &the_watchdog->Node.RBTree, parent, link );
_RBTree_Insert_color( &header->Watchdogs, &the_watchdog->Node.RBTree );
}