28 #ifndef INC_KERNEL_OC_THREAD_H_ 29 #define INC_KERNEL_OC_THREAD_H_ 43 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 49 typedef uint32_t oC_Thread_Priority_t;
51 typedef void (*oC_Thread_Function_t)(
void * UserParameter );
55 oC_Thread_Unblock_WhenEqual ,
56 oC_Thread_Unblock_WhenNotEqual ,
57 oC_Thread_Unblock_WhenSmaller ,
58 oC_Thread_Unblock_WhenGreater ,
59 oC_Thread_Unblock_WhenSmallerOrEqual ,
60 oC_Thread_Unblock_WhenGreaterOrEqual
61 } oC_Thread_Unblock_t;
65 oC_Thread_UnblockMask_None = 0 ,
66 oC_Thread_UnblockMask_All = 0xFFFFFFFFULL
67 }oC_Thread_UnblockMask_t;
69 typedef bool (*oC_Thread_RevertFunction_t)( oC_Thread_t Thread ,
void * Object , uint32_t
Parameter );
70 typedef void (*oC_Thread_FinishedFunction_t)( oC_Thread_t Thread ,
void *
Parameter );
72 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 80 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________ 86 extern oC_Thread_t oC_Thread_CloneWithNewStack ( oC_Thread_t Thread , oC_MemorySize_t NewStackSize );
87 extern bool oC_Thread_Delete ( oC_Thread_t * Thread );
88 extern bool oC_Thread_IsCorrect ( oC_Thread_t Thread );
89 extern bool oC_Thread_IsActive ( oC_Thread_t Thread );
90 extern bool oC_Thread_SetBlocked ( oC_Thread_t Thread , uint32_t * BlockingFlag , oC_Thread_Unblock_t
Unblock , uint32_t
StateToUnblock , oC_Thread_UnblockMask_t
UnblockMask , oC_Time_t Timeout );
91 extern bool oC_Thread_SetUnblocked ( oC_Thread_t Thread );
92 extern bool oC_Thread_IsBlocked ( oC_Thread_t Thread );
93 extern bool oC_Thread_IsBlockedBy ( oC_Thread_t Thread , uint32_t * BlockingFlag );
94 extern bool oC_Thread_Run ( oC_Thread_t Thread );
95 extern bool oC_Thread_Cancel ( oC_Thread_t * Thread );
96 extern void * oC_Thread_GetContext ( oC_Thread_t Thread );
97 extern oC_Thread_Priority_t oC_Thread_GetPriority ( oC_Thread_t Thread );
98 extern void * oC_Thread_GetParameter ( oC_Thread_t Thread );
99 extern const char * oC_Thread_GetName ( oC_Thread_t Thread );
100 extern bool oC_Thread_Sleep ( oC_Thread_t Thread , oC_Time_t Time );
101 extern oC_Time_t oC_Thread_GetExecutionTime ( oC_Thread_t Thread );
102 extern bool oC_Thread_AddToExecutionTime( oC_Thread_t Thread , oC_Time_t Time );
103 extern uint64_t oC_Thread_GetLastExecutionTick(oC_Thread_t Thread );
104 extern bool oC_Thread_SetLastExecutionTick(oC_Thread_t Thread , uint64_t Tick );
105 extern oC_UInt_t oC_Thread_GetStackSize ( oC_Thread_t Thread );
106 extern oC_Int_t oC_Thread_GetFreeStackSize ( oC_Thread_t Thread ,
bool Current );
107 extern bool oC_Thread_SaveToRevert ( oC_Thread_t Thread , oC_Thread_RevertFunction_t
Function,
void * Object , uint32_t
Parameter );
108 extern bool oC_Thread_RemoveFromRevert ( oC_Thread_t Thread , oC_Thread_RevertFunction_t
Function,
void * Object );
109 extern bool oC_Thread_SetFinishedFunction( oC_Thread_t Thread , oC_Thread_FinishedFunction_t
Function,
void *
Parameter );
111 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
The file with interface for the GPIO driver.
oC_Int_t StackSize
!< Tick of last execution
oC_Process_t Process
!< Control value for checking if object is correct
oC_Thread_Unblock_t Unblock
!< Mask with bits important for unblocking
The file with list library.
uint32_t StateToUnblock
!< Reference to the flag of the blocked context
oC_Thread_Function_t Function
!< Size of the stack
oC_Thread_Priority_t Priority
!< Process owner
The file with memory manager interface.
void * Parameter
!< Main function to execute
bool oC_Thread_IsOwnedByStack(oC_Thread_t Thread, const void *Address, bool *outAddressInRedZone)
checks if the given address is owned by the thread stack
uint32_t UnblockMask
!< State to unblock thread
const char * Name
!< Priority of this thread
The file with interface of kernel time module.