2010-09-22 15:10:42 +02:00
|
|
|
/**
|
|
|
|
* @ingroup kernel
|
|
|
|
* @{
|
|
|
|
* @file
|
|
|
|
* @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* tcb.h
|
|
|
|
*
|
|
|
|
* Created on: 19.08.2008
|
|
|
|
* Author: heiko, kaspar
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TCB_H_
|
|
|
|
#define TCB_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2010-11-05 19:33:45 +01:00
|
|
|
#include <queue.h>
|
|
|
|
#include <clist.h>
|
2010-09-22 15:10:42 +02:00
|
|
|
|
|
|
|
/* uneven means has to be on runqueue */
|
2010-11-05 19:33:45 +01:00
|
|
|
#define STATUS_NOT_FOUND (0x0000)
|
|
|
|
#define STATUS_ON_RUNQUEUE (0x0001)
|
|
|
|
#define STATUS_RUNNING (0x0002) + STATUS_ON_RUNQUEUE
|
2010-11-25 16:22:46 +01:00
|
|
|
#define STATUS_PENDING (0x0004) + STATUS_ON_RUNQUEUE
|
2010-11-05 19:33:45 +01:00
|
|
|
#define STATUS_STOPPED (0x0008)
|
|
|
|
#define STATUS_SLEEPING (0x0010)
|
|
|
|
#define STATUS_MUTEX_BLOCKED (0x0020)
|
|
|
|
#define STATUS_RECEIVE_BLOCKED (0x0040)
|
|
|
|
#define STATUS_SEND_BLOCKED (0x0080)
|
|
|
|
#define STATUS_REPLY_BLOCKED (0x0100)
|
|
|
|
#define STATUS_TIMER_WAITING (0x0200)
|
2010-09-22 15:10:42 +02:00
|
|
|
|
|
|
|
typedef struct tcb {
|
|
|
|
char* sp;
|
2010-11-04 17:06:03 +01:00
|
|
|
uint16_t status;
|
2010-09-22 15:10:42 +02:00
|
|
|
|
|
|
|
uint16_t pid;
|
|
|
|
uint16_t priority;
|
|
|
|
|
|
|
|
void* wait_data;
|
|
|
|
queue_node_t msg_queue;
|
|
|
|
|
|
|
|
clist_node_t rq_entry;
|
|
|
|
|
|
|
|
const char* name;
|
|
|
|
char* stack_start;
|
|
|
|
int stack_size;
|
|
|
|
} tcb;
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
#endif /* TCB_H_ */
|