|
|
|
@ -27,22 +27,24 @@
|
|
|
|
|
#include "cib.h"
|
|
|
|
|
#include "msg.h"
|
|
|
|
|
|
|
|
|
|
/* uneven means has to be on runqueue */
|
|
|
|
|
#define STATUS_NOT_FOUND (0x0000) /**< invalid status, may be used as
|
|
|
|
|
* return value to signal an error
|
|
|
|
|
*/
|
|
|
|
|
#define STATUS_ON_RUNQUEUE (0x0001) /**< scheduled to run */
|
|
|
|
|
#define STATUS_RUNNING (0x0002 + STATUS_ON_RUNQUEUE) /**< currently running */
|
|
|
|
|
#define STATUS_PENDING (0x0004 + STATUS_ON_RUNQUEUE) /**< waiting to be scheduled to run */
|
|
|
|
|
#define STATUS_STOPPED (0x0008) /**< has terminated */
|
|
|
|
|
#define STATUS_SLEEPING (0x0010) /**< sleeping */
|
|
|
|
|
#define STATUS_MUTEX_BLOCKED (0x0020) /**< waiting for a locked mutex */
|
|
|
|
|
#define STATUS_RECEIVE_BLOCKED (0x0040) /**< waiting for a message */
|
|
|
|
|
#define STATUS_SEND_BLOCKED (0x0080) /**< waiting for message to be
|
|
|
|
|
* delivered */
|
|
|
|
|
#define STATUS_REPLY_BLOCKED (0x0100) /**< waiting for a message response */
|
|
|
|
|
#define STATUS_TIMER_WAITING (0x0200) /**< waiting for a timer to fire
|
|
|
|
|
* (deprecated) */
|
|
|
|
|
/* thread status list */
|
|
|
|
|
/* blocked states: */
|
|
|
|
|
#define STATUS_STOPPED 0 /**< has terminated */
|
|
|
|
|
#define STATUS_SLEEPING 1 /**< sleeping */
|
|
|
|
|
#define STATUS_MUTEX_BLOCKED 2 /**< waiting for a locked mutex */
|
|
|
|
|
#define STATUS_RECEIVE_BLOCKED 3 /**< waiting for a message */
|
|
|
|
|
#define STATUS_SEND_BLOCKED 4 /**< waiting for message to be
|
|
|
|
|
* delivered */
|
|
|
|
|
#define STATUS_REPLY_BLOCKED 5 /**< waiting for a message response */
|
|
|
|
|
#define STATUS_TIMER_WAITING 6 /**< waiting for a timer to fire */
|
|
|
|
|
|
|
|
|
|
#define STATUS_ON_RUNQUEUE 7 /**< */
|
|
|
|
|
|
|
|
|
|
/* these have to be on a run queue: */
|
|
|
|
|
#define STATUS_RUNNING 7 /**< currently running */
|
|
|
|
|
#define STATUS_PENDING 8 /**< waiting to be scheduled to run */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct tcb_t {
|
|
|
|
|
char *sp;
|
|
|
|
|