[rtems commit] score: Add and use _Scheduler_Get_index_by_id()
Sebastian Huber
sebh at rtems.org
Wed May 21 09:41:01 UTC 2014
Module: rtems
Branch: master
Commit: c8e832886ab97111af01b9271dfb746a45254b23
Changeset: http://git.rtems.org/rtems/commit/?id=c8e832886ab97111af01b9271dfb746a45254b23
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed May 21 10:29:59 2014 +0200
score: Add and use _Scheduler_Get_index_by_id()
---
cpukit/score/include/rtems/score/schedulerimpl.h | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 7c44940..15a4207 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -596,13 +596,19 @@ RTEMS_INLINE_ROUTINE Objects_Id _Scheduler_Build_id( uint32_t scheduler_index )
);
}
+RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_index_by_id( Objects_Id id )
+{
+ uint32_t minimum_id = _Scheduler_Build_id( 0 );
+
+ return id - minimum_id;
+}
+
RTEMS_INLINE_ROUTINE bool _Scheduler_Get_by_id(
Objects_Id id,
const Scheduler_Control **scheduler_p
)
{
- uint32_t minimum_id = _Scheduler_Build_id( 0 );
- uint32_t index = id - minimum_id;
+ uint32_t index = _Scheduler_Get_index_by_id( id );
const Scheduler_Control *scheduler = &_Scheduler_Table[ index ];
*scheduler_p = scheduler;
More information about the vc
mailing list