Yes

Dependents:   Asservissement_Gyro

Committer:
braichi13
Date:
Sun May 08 14:39:47 2022 +0000
Revision:
0:77205fc699b9
Programme du Gyropode

Who changed what in which revision?

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