summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-10 12:49:43 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-10 15:29:57 +0200
commit333f9426f6d4239e33f39da0b2217c58f6fa9046 (patch)
tree64a6b1302bce7449c2345ab5389a23622982c6e8 /cpukit
parentFreeBSD standard shell does not support substring expansion. (diff)
downloadrtems-333f9426f6d4239e33f39da0b2217c58f6fa9046.tar.bz2
score: Fix assertions
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityimpl.h5
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h4
-rw-r--r--cpukit/score/src/schedulersimplesmp.c5
3 files changed, 8 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
index a1aa779721..ab5abdc65f 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
@@ -161,8 +161,11 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Scheduler_priority_Ready_queue_first(
)
{
Priority_Control index = _Priority_bit_map_Get_highest( bit_map );
+ Chain_Node *first = _Chain_First( &ready_queues[ index ] );
- return _Chain_First( &ready_queues[ index ] );
+ _Assert( first != _Chain_Tail( &ready_queues[ index ] ) );
+
+ return first;
}
/**
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 3cf7861d3b..a4890df4d0 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -678,8 +678,6 @@ static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
while ( true ) {
Scheduler_Node *highest_ready = ( *get_highest_ready )( context, node );
- _Assert( highest_ready != NULL );
-
/*
* The node has been extracted from the scheduled chain. We have to place
* it now on the scheduled or ready set.
@@ -761,8 +759,6 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
while ( true ) {
Scheduler_Node *highest_ready = ( *get_highest_ready )( context, victim );
- _Assert( highest_ready != NULL );
-
if (
_Scheduler_Try_to_schedule_node(
context,
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index 084d78251f..733f3dbe9f 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -84,10 +84,13 @@ static Scheduler_Node *_Scheduler_simple_SMP_Get_highest_ready(
{
Scheduler_simple_SMP_Context *self =
_Scheduler_simple_SMP_Get_self( context );
+ Scheduler_Node *first = (Scheduler_Node *) _Chain_First( &self->Ready );
(void) node;
- return (Scheduler_Node *) _Chain_First( &self->Ready );
+ _Assert( &first->Node != _Chain_Tail( &self->Ready ) );
+
+ return first;
}
static void _Scheduler_simple_SMP_Move_from_scheduled_to_ready(