source: rtems/cpukit/score/include/rtems/score/states.h @ 0edf263

4.115
Last change on this file since 0edf263 was 0edf263, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/12 at 08:05:07

rtems: Add system events

System events are similar to normal events. They offer a second set of
events. These events are intended for internal RTEMS use and should not
be used by applications (with the exception of the transient system
event).

  • Property mode set to 100644
File size: 5.3 KB
RevLine 
[20f02c6]1/**
[11874561]2 *  @file  rtems/score/states.h
[ac7d5ef0]3 *
[3a4ae6c]4 *  This include file contains thread execution state information.
[baff4da]5 */
6
7/*
[6a07436]8 *  COPYRIGHT (c) 1989-2006.
[ac7d5ef0]9 *  On-Line Applications Research Corporation (OAR).
10 *
[98e4ebf5]11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
[dd687d97]13 *  http://www.rtems.com/license/LICENSE.
[ac7d5ef0]14 */
15
[092f142a]16#ifndef _RTEMS_SCORE_STATES_H
17#define _RTEMS_SCORE_STATES_H
[ac7d5ef0]18
[baff4da]19/**
20 *  @defgroup ScoreStates Thread States Handler
21 *
[d8cd045c]22 *  @ingroup Score
23 *
[20f02c6]24 *  This handler encapsulates functionality which relates to the management of
[6a07436]25 *  the state bitmap associated with each thread.
[baff4da]26 */
27/**@{*/
28
[ac7d5ef0]29#ifdef __cplusplus
30extern "C" {
31#endif
32
[6a07436]33/**
[ac7d5ef0]34 *  The following type defines the control block used to manage a
35 *  thread's state.
36 */
[d6154c7]37typedef uint32_t   States_Control;
[ac7d5ef0]38
39/*
40 *  The following constants define the individual states which may be
41 *  be used to compose and manipulate a thread's state.
42 */
43
[6a07436]44/** This macro corresponds to all states being set. */
[9c191ee]45#define STATES_ALL_SET                         0xfffff
[6a07436]46/** This macro corresponds to a task being ready. */
[9c191ee]47#define STATES_READY                           0x00000
[6a07436]48/** This macro corresponds to a task being created but not yet started. */
[9c191ee]49#define STATES_DORMANT                         0x00001
[6a07436]50/** This macro corresponds to a task being suspended. */
[9c191ee]51#define STATES_SUSPENDED                       0x00002
[6a07436]52/** This macro corresponds to a task being in an internal state transition. */
[9c191ee]53#define STATES_TRANSIENT                       0x00004
[6a07436]54/** This macro corresponds to a task which is waiting for a timeout. */
[9c191ee]55#define STATES_DELAYING                        0x00008
[6a07436]56/** This macro corresponds to a task waiting until a specific TOD. */
[9c191ee]57#define STATES_WAITING_FOR_TIME                0x00010
[6a07436]58/** This macro corresponds to a task waiting for a variable length buffer. */
[a0ed4ed]59#define STATES_WAITING_FOR_BUFFER              0x00020
[6a07436]60/** This macro corresponds to a task waiting for a fixed size segment. */
[4a1bc34b]61#define STATES_WAITING_FOR_SEGMENT             0x00040
[6a07436]62/** This macro corresponds to a task waiting for a message. */
[4a1bc34b]63#define STATES_WAITING_FOR_MESSAGE             0x00080
[6a07436]64/** This macro corresponds to a task waiting for an event. */
[4a1bc34b]65#define STATES_WAITING_FOR_EVENT               0x00100
[6a07436]66/** This macro corresponds to a task waiting for a semaphore. */
[4a1bc34b]67#define STATES_WAITING_FOR_SEMAPHORE           0x00200
[6a07436]68/** This macro corresponds to a task waiting for a mutex. */
[4a1bc34b]69#define STATES_WAITING_FOR_MUTEX               0x00400
[6a07436]70/** This macro corresponds to a task waiting for a condition variable. */
[4a1bc34b]71#define STATES_WAITING_FOR_CONDITION_VARIABLE  0x00800
[6a07436]72/** This macro corresponds to a task waiting for a join while exiting. */
[4a1bc34b]73#define STATES_WAITING_FOR_JOIN_AT_EXIT        0x01000
[6a07436]74/** This macro corresponds to a task waiting for a reply to an MPCI request. */
[4a1bc34b]75#define STATES_WAITING_FOR_RPC_REPLY           0x02000
[6a07436]76/** This macro corresponds to a task waiting for a period. */
[4a1bc34b]77#define STATES_WAITING_FOR_PERIOD              0x04000
[6a07436]78/** This macro corresponds to a task waiting for a signal. */
[4a1bc34b]79#define STATES_WAITING_FOR_SIGNAL              0x08000
[9c191ee]80/** This macro corresponds to a task waiting for a barrier. */
81#define STATES_WAITING_FOR_BARRIER             0x10000
82/** This macro corresponds to a task waiting for a RWLock. */
83#define STATES_WAITING_FOR_RWLOCK              0x20000
[0edf263]84/** This macro corresponds to a task waiting for a system event. */
85#define STATES_WAITING_FOR_SYSTEM_EVENT        0x40000
[9c191ee]86
[6a07436]87/** This macro corresponds to a task which is in an interruptible
88 *  blocking state.
89 */
[9c191ee]90#define STATES_INTERRUPTIBLE_BY_SIGNAL         0x10000000
[5e9b32b]91
[6a07436]92/** This macro corresponds to a task waiting for a local object operation. */
[5e9b32b]93#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER             | \
94                                 STATES_WAITING_FOR_SEGMENT            | \
95                                 STATES_WAITING_FOR_MESSAGE            | \
[81daab3]96                                 STATES_WAITING_FOR_SEMAPHORE          | \
[5e9b32b]97                                 STATES_WAITING_FOR_MUTEX              | \
98                                 STATES_WAITING_FOR_CONDITION_VARIABLE | \
[4a1bc34b]99                                 STATES_WAITING_FOR_JOIN_AT_EXIT       | \
[9c191ee]100                                 STATES_WAITING_FOR_SIGNAL             | \
101                                 STATES_WAITING_FOR_BARRIER            | \
[20f02c6]102                                 STATES_WAITING_FOR_RWLOCK             )
[ac7d5ef0]103
[6a07436]104/** This macro corresponds to a task waiting which is blocked on
105 *  a thread queue. */
[ac7d5ef0]106#define STATES_WAITING_ON_THREAD_QUEUE \
107                               ( STATES_LOCALLY_BLOCKED         | \
108                                 STATES_WAITING_FOR_RPC_REPLY   )
109
[6a07436]110/** This macro corresponds to a task waiting which is blocked. */
[ac7d5ef0]111#define STATES_BLOCKED         ( STATES_DELAYING                | \
112                                 STATES_WAITING_FOR_TIME        | \
113                                 STATES_WAITING_FOR_PERIOD      | \
114                                 STATES_WAITING_FOR_EVENT       | \
[0edf263]115                                 STATES_WAITING_FOR_SYSTEM_EVENT | \
[12aeff91]116                                 STATES_WAITING_ON_THREAD_QUEUE | \
117                                 STATES_INTERRUPTIBLE_BY_SIGNAL )
[ac7d5ef0]118
[1a8fde6c]119#ifndef __RTEMS_APPLICATION__
[5e9b32b]120#include <rtems/score/states.inl>
[1a8fde6c]121#endif
[ac7d5ef0]122
123#ifdef __cplusplus
124}
125#endif
126
[baff4da]127/**@}*/
128
[ac7d5ef0]129#endif
130/* end of include file */
Note: See TracBrowser for help on using the repository browser.