diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-08-02 16:22:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-08-05 09:30:33 +0200 |
commit | 40dcafaf80a29c20d74594853a8ff04441eabd9c (patch) | |
tree | 1541f69ee011198bd995f38069a2b1300fc4de76 /cpukit/score/include/rtems/score/threadimpl.h | |
parent | rbtree: Rename find header in find control (diff) | |
download | rtems-40dcafaf80a29c20d74594853a8ff04441eabd9c.tar.bz2 |
Add and use RTEMS_CONTAINER_OF()
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index a527c8beca..9321c017b8 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -76,6 +76,14 @@ SCORE_EXTERN Thread_Control *_Thread_Allocated_fp; SCORE_EXTERN struct _reent **_Thread_libc_reent; #endif +#define THREAD_RBTREE_NODE_TO_THREAD( node ) \ + RTEMS_CONTAINER_OF( node, Thread_Control, RBNode ) + +#if defined(RTEMS_SMP) +#define THREAD_RESOURCE_NODE_TO_THREAD( node ) \ + RTEMS_CONTAINER_OF( node, Thread_Control, Resource_node ) +#endif + /** * @brief Initialize thread handler. * @@ -846,16 +854,6 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources( return owns_resources; } -#if defined(RTEMS_SMP) -RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Resource_node_to_thread( - Resource_Node *node -) -{ - return (Thread_Control *) - ( (char *) node - offsetof( Thread_Control, Resource_node ) ); -} -#endif - RTEMS_INLINE_ROUTINE void _Thread_Debug_set_real_processor( Thread_Control *the_thread, Per_CPU_Control *cpu |