Changeset 9a448aab in rtems


Ignore:
Timestamp:
Dec 23, 2016, 3:02:07 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
4e07d9b3
Parents:
c6000d2b
git-author:
Sebastian Huber <sebastian.huber@…> (12/23/16 15:02:07)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/11/17 07:16:27)
Message:

score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIER

Add thread state bit to identify thread queues that are embedded in an
object with identifier.

Location:
cpukit
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdebugger/rtems-debugger-threads.c

    rc6000d2b r9a448aab  
    522522    { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE },
    523523    { "Wevnt",  STATES_WAITING_FOR_EVENT },
    524     { "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL },
     524    { "ISIG" ,  STATES_INTERRUPTIBLE_BY_SIGNAL },
    525525    { "Wjatx",  STATES_WAITING_FOR_JOIN_AT_EXIT },
    526526    { "Wjoin",  STATES_WAITING_FOR_JOIN },
     
    533533    { "Wsem",   STATES_WAITING_FOR_SEMAPHORE },
    534534    { "Wsig",   STATES_WAITING_FOR_SIGNAL },
    535     { "Wslcnd", STATES_WAITING_FOR_SYS_LOCK_CONDITION },
    536     { "Wslftx", STATES_WAITING_FOR_SYS_LOCK_FUTEX },
    537     { "Wslmtx", STATES_WAITING_FOR_SYS_LOCK_MUTEX },
    538     { "Wslsem", STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE },
     535    { "Wfutex", STATES_WAITING_FOR_FUTEX },
     536    { "TQID",   STATES_THREAD_QUEUE_WITH_IDENTIFIER },
    539537    { "Wsysev", STATES_WAITING_FOR_SYSTEM_EVENT },
    540538    { "Wtime",  STATES_WAITING_FOR_TIME },
  • cpukit/libmisc/monitor/mon-prmisc.c

    rc6000d2b r9a448aab  
    113113}
    114114
     115#define WITH_ID(state) (STATES_THREAD_QUEUE_WITH_IDENTIFIER | state)
     116
    115117static const rtems_assoc_t rtems_monitor_state_assoc[] = {
    116118    { "DELAY",  STATES_DELAYING, 0 },
     
    118120    { "LIFE",   STATES_LIFE_IS_CHANGING, 0 },
    119121    { "SUSP",   STATES_SUSPENDED, 0 },
    120     { "Wbar",   STATES_WAITING_FOR_BARRIER, 0 },
    121     { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE, 0 },
     122    { "Wbar",   WITH_ID(STATES_WAITING_FOR_BARRIER), 0 },
     123    { "Wcvar",  WITH_ID(STATES_WAITING_FOR_CONDITION_VARIABLE), 0 },
    122124    { "Wevnt",  STATES_WAITING_FOR_EVENT, 0 },
    123125    { "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL, 0 },
    124126    { "Wjatx",  STATES_WAITING_FOR_JOIN_AT_EXIT, 0 },
    125127    { "Wjoin",  STATES_WAITING_FOR_JOIN, 0 },
    126     { "Wmsg" ,  STATES_WAITING_FOR_MESSAGE, 0 },
    127     { "Wmutex", STATES_WAITING_FOR_MUTEX, 0 },
     128    { "Wmsg" ,  WITH_ID(STATES_WAITING_FOR_MESSAGE), 0 },
     129    { "Wmutex", WITH_ID(STATES_WAITING_FOR_MUTEX), 0 },
    128130    { "WRATE",  STATES_WAITING_FOR_PERIOD, 0 },
    129131    { "Wrpc",   STATES_WAITING_FOR_RPC_REPLY, 0 },
    130     { "Wrwlk",  STATES_WAITING_FOR_RWLOCK, 0 },
     132    { "Wrwlk",  WITH_ID(STATES_WAITING_FOR_RWLOCK), 0 },
    131133    { "Wseg",   STATES_WAITING_FOR_SEGMENT, 0 },
     134    { "Wsem",   WITH_ID(STATES_WAITING_FOR_SEMAPHORE), 0 },
     135    { "Wsig",   STATES_WAITING_FOR_SIGNAL, 0 },
     136    { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE, 0 },
     137    { "Wfutex", STATES_WAITING_FOR_FUTEX, 0 },
     138    { "Wmutex", STATES_WAITING_FOR_MUTEX, 0 },
    132139    { "Wsem",   STATES_WAITING_FOR_SEMAPHORE, 0 },
    133     { "Wsig",   STATES_WAITING_FOR_SIGNAL, 0 },
    134     { "Wslcnd", STATES_WAITING_FOR_SYS_LOCK_CONDITION, 0 },
    135     { "Wslftx", STATES_WAITING_FOR_SYS_LOCK_FUTEX, 0 },
    136     { "Wslmtx", STATES_WAITING_FOR_SYS_LOCK_MUTEX, 0 },
    137     { "Wslsem", STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE, 0 },
    138140    { "Wsysev", STATES_WAITING_FOR_SYSTEM_EVENT, 0 },
    139141    { "Wtime",  STATES_WAITING_FOR_TIME, 0 },
  • cpukit/posix/src/condwaitsupp.c

    rc6000d2b r9a448aab  
    120120    _Thread_queue_Context_set_thread_state(
    121121      &queue_context,
    122       STATES_WAITING_FOR_CONDITION_VARIABLE
     122      STATES_THREAD_QUEUE_WITH_IDENTIFIER
     123        | STATES_WAITING_FOR_CONDITION_VARIABLE
    123124    );
    124125    _Thread_queue_Context_set_enqueue_callout(
  • cpukit/score/include/rtems/score/coresemimpl.h

    rc6000d2b r9a448aab  
    187187  _Thread_queue_Context_set_thread_state(
    188188    queue_context,
    189     STATES_WAITING_FOR_SEMAPHORE
     189    STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_SEMAPHORE
    190190  );
    191191  _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/include/rtems/score/statesimpl.h

    rc6000d2b r9a448aab  
    8383/** This macro corresponds to a task waiting for a join. */
    8484#define STATES_WAITING_FOR_JOIN                0x01000000
    85 /** This macro corresponds to a task waiting for a <sys/lock.h> mutex. */
    86 #define STATES_WAITING_FOR_SYS_LOCK_MUTEX      0x02000000
    87 /** This macro corresponds to a task waiting for a <sys/lock.h> semaphore. */
    88 #define STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE  0x04000000
    89 /** This macro corresponds to a task waiting for a <sys/lock.h> futex. */
    90 #define STATES_WAITING_FOR_SYS_LOCK_FUTEX      0x08000000
     85/** This macro corresponds to a task waiting for a futex. */
     86#define STATES_WAITING_FOR_FUTEX               0x08000000
    9187
    9288/** This macro corresponds to a task which is in an interruptible
     
    9490 */
    9591#define STATES_INTERRUPTIBLE_BY_SIGNAL         0x10000000
    96 /** This macro corresponds to a task waiting for a <sys/lock.h> condition. */
    97 #define STATES_WAITING_FOR_SYS_LOCK_CONDITION  0x20000000
     92
     93/**
     94 * @brief This macro corresponds to a task which is blocked on a thread queue
     95 * embedded in an object with an identifier.
     96 *
     97 * This thread state bit is intended to ease debugging and improve system
     98 * diagnostics, see _Thread_Wait_get_id().
     99 */
     100#define STATES_THREAD_QUEUE_WITH_IDENTIFIER    0x80000000
    98101
    99102/** This macro corresponds to a task waiting for a local object operation. */
    100 #define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_SEGMENT            | \
     103#define STATES_LOCALLY_BLOCKED ( STATES_THREAD_QUEUE_WITH_IDENTIFIER   | \
     104                                 STATES_WAITING_FOR_SEGMENT            | \
    101105                                 STATES_WAITING_FOR_MESSAGE            | \
    102106                                 STATES_WAITING_FOR_SEMAPHORE          | \
     
    107111                                 STATES_WAITING_FOR_BARRIER            | \
    108112                                 STATES_WAITING_FOR_BSD_WAKEUP         | \
    109                                  STATES_WAITING_FOR_SYS_LOCK_MUTEX     | \
    110                                  STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE | \
    111                                  STATES_WAITING_FOR_SYS_LOCK_FUTEX     | \
    112                                  STATES_WAITING_FOR_SYS_LOCK_CONDITION | \
     113                                 STATES_WAITING_FOR_FUTEX              | \
    113114                                 STATES_WAITING_FOR_RWLOCK             )
    114115
  • cpukit/score/src/condition.c

    rc6000d2b r9a448aab  
    112112  _Thread_queue_Context_set_thread_state(
    113113    &context->Base,
    114     STATES_WAITING_FOR_SYS_LOCK_CONDITION
     114    STATES_WAITING_FOR_CONDITION_VARIABLE
    115115  );
    116116  _Thread_queue_Context_set_enqueue_callout(
  • cpukit/score/src/corebarrierwait.c

    rc6000d2b r9a448aab  
    4747    _Thread_queue_Context_set_thread_state(
    4848      queue_context,
    49       STATES_WAITING_FOR_BARRIER
     49      STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_BARRIER
    5050    );
    5151    _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/coremsgseize.c

    rc6000d2b r9a448aab  
    116116  _Thread_queue_Context_set_thread_state(
    117117    queue_context,
    118     STATES_WAITING_FOR_MESSAGE
     118    STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MESSAGE
    119119  );
    120120  _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/coremsgsubmit.c

    rc6000d2b r9a448aab  
    134134    _Thread_queue_Context_set_thread_state(
    135135      queue_context,
    136       STATES_WAITING_FOR_MESSAGE
     136      STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MESSAGE
    137137    );
    138138    _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/coremutexseize.c

    rc6000d2b r9a448aab  
    3535    _Thread_queue_Context_set_thread_state(
    3636      queue_context,
    37       STATES_WAITING_FOR_MUTEX
     37      STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MUTEX
    3838    );
    3939    _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/corerwlockobtainread.c

    rc6000d2b r9a448aab  
    8181  _Thread_queue_Context_set_thread_state(
    8282    queue_context,
    83    STATES_WAITING_FOR_RWLOCK
     83   STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_RWLOCK
    8484  );
    8585  _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/corerwlockobtainwrite.c

    rc6000d2b r9a448aab  
    6969  _Thread_queue_Context_set_thread_state(
    7070    queue_context,
    71     STATES_WAITING_FOR_RWLOCK
     71    STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_RWLOCK
    7272  );
    7373  _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/futex.c

    rc6000d2b r9a448aab  
    9595    _Thread_queue_Context_set_thread_state(
    9696      &queue_context,
    97       STATES_WAITING_FOR_SYS_LOCK_FUTEX
     97      STATES_WAITING_FOR_FUTEX
    9898    );
    9999    _Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
  • cpukit/score/src/mutex.c

    rc6000d2b r9a448aab  
    112112  _Thread_queue_Context_set_thread_state(
    113113    queue_context,
    114     STATES_WAITING_FOR_SYS_LOCK_MUTEX
     114    STATES_WAITING_FOR_MUTEX
    115115  );
    116116  _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
  • cpukit/score/src/semaphore.c

    rc6000d2b r9a448aab  
    106106    _Thread_queue_Context_set_thread_state(
    107107      &queue_context,
    108       STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE
     108      STATES_WAITING_FOR_SEMAPHORE
    109109    );
    110110    _Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
  • cpukit/score/src/threadwaitgetid.c

    rc6000d2b r9a448aab  
    1919#include <rtems/score/threadimpl.h>
    2020
    21 #define THREAD_WAIT_QUEUE_OBJECT_STATES \
    22   ( STATES_WAITING_FOR_BARRIER \
    23     | STATES_WAITING_FOR_CONDITION_VARIABLE \
    24     | STATES_WAITING_FOR_MESSAGE \
    25     | STATES_WAITING_FOR_MUTEX \
    26     | STATES_WAITING_FOR_RWLOCK \
    27     | STATES_WAITING_FOR_SEMAPHORE )
    28 
    2921Objects_Id _Thread_Wait_get_id( const Thread_Control *the_thread )
    3022{
     
    3931#endif
    4032
    41   if ( ( current_state & THREAD_WAIT_QUEUE_OBJECT_STATES ) != 0 ) {
     33  if ( ( current_state & STATES_THREAD_QUEUE_WITH_IDENTIFIER ) != 0 ) {
    4234    const Thread_queue_Object *queue_object;
    4335
Note: See TracChangeset for help on using the changeset viewer.