μcosii源码试读3- OS_InitTCBList();任务控制块链表初始化及其功能(2)
- UID
- 1029342
- 性别
- 男
|
μcosii源码试读3- OS_InitTCBList();任务控制块链表初始化及其功能(2)
任务控制块是一个数据结构,其内容如下,这个结构在我理解相当于进程描述符的作用
点击(此处)折叠或打开
- /*
- *********************************************************************************************************
- * TASK CONTROL BLOCK
- *********************************************************************************************************
- */
- typedef struct os_tcb {
- OS_STK *OSTCBStkPtr; /* Pointer to current top of stack */
- #if OS_TASK_CREATE_EXT_EN > 0
- void *OSTCBExtPtr; /* Pointer to user definable data for TCB extension */
- OS_STK *OSTCBStkBottom; /* Pointer to bottom of stack */
- INT32U OSTCBStkSize; /* Size of task stack (in number of stack elements) */
- INT16U OSTCBOpt; /* Task options as passed by OSTaskCreateExt() */
- INT16U OSTCBId; /* Task ID (0..65535) */
- #endif
- struct os_tcb *OSTCBNext; /* Pointer to next TCB in the TCB list */
- struct os_tcb *OSTCBPrev; /* Pointer to previous TCB in the TCB list */
- #if OS_EVENT_EN
- OS_EVENT *OSTCBEventPtr; /* Pointer to event control block */
- #endif
- #if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0)
- void *OSTCBMsg; /* Message received from OSMboxPost() or OSQPost() */
- #endif
- #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
- #if OS_TASK_DEL_EN > 0
|
|
|
|
|
|