R_RTOS
0.1
DistributedRealTimeOperatingSystemfortheARMCortexMArchitecture
|
Functions for creating, initializing, maintaining and handling a task's stack. More...
Macros | |
#define | portINITIAL_XPSR ( (uint32_t)0x01000000u ) |
initial XPSR value for a task. | |
#define | MY_STACK_SIZE ((StackSize)0x80u) |
Default value for a task's stack size. | |
#define | IDLE_TSK_STACK_SIZE ((StackSize)0x60u) |
Stack size for the IDLE Task. | |
#define | STACK_BLOCK_SIZE ((uint8_t)0x4u) |
Size of one stack element in byte. | |
Typedefs | |
typedef uint16_t | StackSize |
Used to describe the size of a stack. | |
typedef uint32_t | StackTypeT |
Base type of a stack element. | |
typedef StackTypeT * | StackPtrT |
Pointer to a StackTypeT. More... | |
Functions | |
RetCode | stk_StackCreate (register PTskTCB tsk, register StackSize desiredStackSize) |
Creates a stack for a task with the size of desiredStackSize. More... | |
RetCode | stk_StackInit (register PTskTCB tsk, void *fktParam) |
Initializes the initial stack frame according to the given input parameters. More... | |
RetCode | stk_StackDestroy (register PTskTCB tsk) |
Destroys the stack of the task indicated by the tsk input parameter. More... | |
RetCode | stk_TSTStck (PTskTCB const tsk) |
fill the task's stack with a distinctive pattern. More... | |
RetCode | stk_StackClear (PTskTCB const tsk) |
Clears the provided task's stack. More... | |
Functions for creating, initializing, maintaining and handling a task's stack.
typedef StackTypeT* StackPtrT |
Pointer to a StackTypeT.
Also used to point to the current, the top and the bottom StackTypeT.
Clears the provided task's stack.
//ToDO IMPLEMENT FUNCTION
[in] | tsk | Pointer to the task's TskTCB |
Sets all stack elements to zero regardless of the current stack pointer's position.
Creates a stack for a task with the size of desiredStackSize.
[in] | tsk | Pointer to the task's TskTCB |
[in] | desiredStackSize | Size of the stack to be created |
Allocates memory and creates the stack for the task and sets all pointers for stack management in the TskTCB.
Destroys the stack of the task indicated by the tsk input parameter.
[in] | tsk | Pointer to the task's TskTCB whose stack shall be destroyed |
Destroys the given stack and frees all resources. //ToDO Also checks for stack overflow and underflow.
Initializes the initial stack frame according to the given input parameters.
[in] | tsk | Pointer to the task's TskTCB, which contains all needed parameters |
[in] | fktParam | Pointer to the input parameter that shall be passed to the task ( NULL means no input parameter ) |
Builds the initial stack frame needed for switching the context to the task's beginning according to the provided input parameters. Adjusts the task's stack pointer accordingly.