...
os.h/os_cpu_c.c and os_app_hooks.c
Prototype
Code Block |
---|
void OSRedzoneHitHook (OS_TCB *p_tcb) |
Arguments
p_tcb
is a pointer to the TCB of the offending task. Note that p_tcb
can be NULL
. In that case, the ISR stack is corrupted.
...
In the example below, OSRedzoneHitHook()
calls App_OS_RedzoneHitHook()
if the pointer OS_AppRedzoneHitHookPtr
is set to that function.
Code Block | ||
---|---|---|
| ||
void App_OS_RedzoneHitHook (OS_TCB *p_tcb) /* os_app_hooks.c */ { (void)&p_tcb; CPU_SW_EXCEPTION(;); } void App_OS_SetAllHooks (void) /* os_app_hooks.c */ { CPU_SR_ALLOC(); CPU_CRITICAL_ENTER(); : OS_AppRedzoneHitHookPtr = App_OS_RedzoneHitHook; : CPU_CRITICAL_EXIT(); } void OSRedzoneHitHook (OS_TCB *p_tcb) /* os_cpu_c.c */ { #if OS_CFG_APP_HOOKS_EN > 0u if (OS_AppRedzoneHitHookPtr != (OS_APP_HOOK_TCB)0) { (*OS_AppRedzoneHitHookPtr)(p_tcb); } #endif (void)p_tcb; CPU_SW_EXCEPTION(;); } |