Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

os_tcb.h 2.3KB

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