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