The code from https://github.com/vpcola/Nucleo
mbed-rtos/rtx/os_tcb.h@0:5464d5e415e5, 2014-10-08 (annotated)
- Committer:
- sinrab
- Date:
- Wed Oct 08 11:00:24 2014 +0000
- Revision:
- 0:5464d5e415e5
The code from https://github.com/vpcola/Nucleo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sinrab | 0:5464d5e415e5 | 1 | #ifndef OS_TCB_H |
sinrab | 0:5464d5e415e5 | 2 | #define OS_TCB_H |
sinrab | 0:5464d5e415e5 | 3 | |
sinrab | 0:5464d5e415e5 | 4 | /* Types */ |
sinrab | 0:5464d5e415e5 | 5 | typedef char S8; |
sinrab | 0:5464d5e415e5 | 6 | typedef unsigned char U8; |
sinrab | 0:5464d5e415e5 | 7 | typedef short S16; |
sinrab | 0:5464d5e415e5 | 8 | typedef unsigned short U16; |
sinrab | 0:5464d5e415e5 | 9 | typedef int S32; |
sinrab | 0:5464d5e415e5 | 10 | typedef unsigned int U32; |
sinrab | 0:5464d5e415e5 | 11 | typedef long long S64; |
sinrab | 0:5464d5e415e5 | 12 | typedef unsigned long long U64; |
sinrab | 0:5464d5e415e5 | 13 | typedef unsigned char BIT; |
sinrab | 0:5464d5e415e5 | 14 | typedef unsigned int BOOL; |
sinrab | 0:5464d5e415e5 | 15 | typedef void (*FUNCP)(void); |
sinrab | 0:5464d5e415e5 | 16 | |
sinrab | 0:5464d5e415e5 | 17 | typedef struct OS_TCB { |
sinrab | 0:5464d5e415e5 | 18 | /* General part: identical for all implementations. */ |
sinrab | 0:5464d5e415e5 | 19 | U8 cb_type; /* Control Block Type */ |
sinrab | 0:5464d5e415e5 | 20 | U8 state; /* Task state */ |
sinrab | 0:5464d5e415e5 | 21 | U8 prio; /* Execution priority */ |
sinrab | 0:5464d5e415e5 | 22 | U8 task_id; /* Task ID value for optimized TCB access */ |
sinrab | 0:5464d5e415e5 | 23 | struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */ |
sinrab | 0:5464d5e415e5 | 24 | struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */ |
sinrab | 0:5464d5e415e5 | 25 | struct OS_TCB *p_dlnk; /* Link pointer for delay list */ |
sinrab | 0:5464d5e415e5 | 26 | struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */ |
sinrab | 0:5464d5e415e5 | 27 | U16 delta_time; /* Time until time out */ |
sinrab | 0:5464d5e415e5 | 28 | U16 interval_time; /* Time interval for periodic waits */ |
sinrab | 0:5464d5e415e5 | 29 | U16 events; /* Event flags */ |
sinrab | 0:5464d5e415e5 | 30 | U16 waits; /* Wait flags */ |
sinrab | 0:5464d5e415e5 | 31 | void **msg; /* Direct message passing when task waits */ |
sinrab | 0:5464d5e415e5 | 32 | |
sinrab | 0:5464d5e415e5 | 33 | /* Hardware dependant part: specific for CM processor */ |
sinrab | 0:5464d5e415e5 | 34 | U8 stack_frame; /* Stack frame: 0=Basic, 1=Extended */ |
sinrab | 0:5464d5e415e5 | 35 | U8 reserved; |
sinrab | 0:5464d5e415e5 | 36 | U16 priv_stack; /* Private stack size in bytes */ |
sinrab | 0:5464d5e415e5 | 37 | U32 tsk_stack; /* Current task Stack pointer (R13) */ |
sinrab | 0:5464d5e415e5 | 38 | U32 *stack; /* Pointer to Task Stack memory block */ |
sinrab | 0:5464d5e415e5 | 39 | |
sinrab | 0:5464d5e415e5 | 40 | /* Library dependant part */ |
sinrab | 0:5464d5e415e5 | 41 | #if defined (__CC_ARM) && !defined (__MICROLIB) |
sinrab | 0:5464d5e415e5 | 42 | /* A memory space for arm standard library. */ |
sinrab | 0:5464d5e415e5 | 43 | U32 std_libspace[96/4]; |
sinrab | 0:5464d5e415e5 | 44 | #endif |
sinrab | 0:5464d5e415e5 | 45 | |
sinrab | 0:5464d5e415e5 | 46 | /* Task entry point used for uVision debugger */ |
sinrab | 0:5464d5e415e5 | 47 | FUNCP ptask; /* Task entry address */ |
sinrab | 0:5464d5e415e5 | 48 | } *P_TCB; |
sinrab | 0:5464d5e415e5 | 49 | |
sinrab | 0:5464d5e415e5 | 50 | #endif |
sinrab | 0:5464d5e415e5 | 51 |