diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-11 14:56:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:48 +0200 |
commit | d8752860e50a495f5d886275b7eb407aa9ec8b1c (patch) | |
tree | d3cc1f9861b43ce7e27298492856ab931734b900 /cpukit/score | |
parent | score: Do not inline SMP lock if profiling enabled (diff) | |
download | rtems-d8752860e50a495f5d886275b7eb407aa9ec8b1c.tar.bz2 |
score: Add static initializers for thread queues
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index 79fc810b9b..32217ad73e 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -20,6 +20,8 @@ #define _RTEMS_SCORE_THREADQIMPL_H #include <rtems/score/threadq.h> +#include <rtems/score/chainimpl.h> +#include <rtems/score/rbtreeimpl.h> #include <rtems/score/thread.h> #ifdef __cplusplus @@ -342,6 +344,38 @@ void _Thread_queue_Initialize( Thread_queue_Disciplines the_discipline ); +#if defined(RTEMS_SMP) + #define THREAD_QUEUE_FIFO_INITIALIZER( designator, name ) { \ + .Queues = { \ + .Fifo = CHAIN_INITIALIZER_EMPTY( designator.Queues.Fifo ) \ + }, \ + .operations = &_Thread_queue_Operations_FIFO, \ + .Lock = ISR_LOCK_INITIALIZER( name ) \ + } + + #define THREAD_QUEUE_PRIORIY_INITIALIZER( designator, name ) { \ + .Queues = { \ + .Priority = RBTREE_INITIALIZER_EMPTY( designator.Queues.Priority ) \ + }, \ + .operations = &_Thread_queue_Operations_priority, \ + .Lock = ISR_LOCK_INITIALIZER( name ) \ + } +#else + #define THREAD_QUEUE_FIFO_INITIALIZER( designator, name ) { \ + .Queues = { \ + .Fifo = CHAIN_INITIALIZER_EMPTY( designator.Queues.Fifo ) \ + }, \ + .operations = &_Thread_queue_Operations_FIFO \ + } + + #define THREAD_QUEUE_PRIORIY_INITIALIZER( designator, name ) { \ + .Queues = { \ + .Priority = RBTREE_INITIALIZER_EMPTY( designator.Queues.Priority ) \ + }, \ + .operations = &_Thread_queue_Operations_priority \ + } +#endif + RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy( Thread_queue_Control *the_thread_queue ) |