distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
distortos::architecture::anonymous_namespace{ARMv6-M-ARMv7-M-requestFunctionExecution.cpp} Namespace Reference

Functions

void removeStackFrame (const void *const savedStackPointer, const bool fpuContextActive)
 Removes stack frame inserted by requestFunctionExecution() in case of interrupt -> current thread request. More...
 
void functionTrampoline (void(&function)(), const void *const savedStackPointer, const bool fullContext)
 Trampoline used to execute function on new stack frame. More...
 
int fromInterruptToCurrentThread (internal::ThreadControlBlock &threadControlBlock, void(&function)())
 Handles request coming from interrupt context to execute provided function in current thread. More...
 
int toNonCurrentThread (internal::ThreadControlBlock &threadControlBlock, void(&function)())
 Handles request to execute provided function in non-current thread. More...
 

Function Documentation

◆ fromInterruptToCurrentThread()

int distortos::architecture::anonymous_namespace{ARMv6-M-ARMv7-M-requestFunctionExecution.cpp}::fromInterruptToCurrentThread ( internal::ThreadControlBlock threadControlBlock,
void(&)()  function 
)

Handles request coming from interrupt context to execute provided function in current thread.

Parameters
[in]threadControlBlockis a reference to ThreadControlBlock of current thread
[in]functionis a reference to function that should be executed in current thread
Returns
0 on success, error code otherwise:
  • ENOSPC - amount of free stack is too small to request function execution;
Here is the call graph for this function:
Here is the caller graph for this function:

◆ functionTrampoline()

void distortos::architecture::anonymous_namespace{ARMv6-M-ARMv7-M-requestFunctionExecution.cpp}::functionTrampoline ( void(&)()  function,
const void *const  savedStackPointer,
const bool  fullContext 
)

Trampoline used to execute function on new stack frame.

After the function returns stack frame is removed and old stack pointer value is restored.

Parameters
[in]functionis a reference to function that will be executed
[in]savedStackPointeris the stack pointer value before new stack frame was created
[in]fullContextis an information about type of previous stack frame - "full", when the thread was not running (true) or "interrupt", when the thread was running and was interrupted (false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeStackFrame()

void distortos::architecture::anonymous_namespace{ARMv6-M-ARMv7-M-requestFunctionExecution.cpp}::removeStackFrame ( const void *const  savedStackPointer,
const bool  fpuContextActive 
)

Removes stack frame inserted by requestFunctionExecution() in case of interrupt -> current thread request.

Parameters
[in]savedStackPointeris the stack pointer value before new stack frame was created
[in]fpuContextActive(only when FPU is enabled) tells whether thread has active FPU context (true) or not (false)
Here is the caller graph for this function:

◆ toNonCurrentThread()

int distortos::architecture::anonymous_namespace{ARMv6-M-ARMv7-M-requestFunctionExecution.cpp}::toNonCurrentThread ( internal::ThreadControlBlock threadControlBlock,
void(&)()  function 
)

Handles request to execute provided function in non-current thread.

Parameters
[in]threadControlBlockis a reference to internal::ThreadControlBlock of thread in which function should be executed
[in]functionis a reference to function that should be executed in thread associated with threadControlBlock
Returns
0 on success, error code otherwise:
  • ENOSPC - amount of free stack is too small to request function execution;
Here is the call graph for this function:
Here is the caller graph for this function: