stack_sentinel: change cooperative check
One of the stack sentinel policies was to check the sentinel any time a cooperative context switch is done (i.e, _Swap is called). This was done by adding a hook to _check_stack_sentinel in every arch's __swap function. This way is cleaner as we just have the hook in one inline function rather than implemented in several different assembly dialects. The check upon interrupt is now made unconditionally rather than checking if we are calling __swap, since the check now is only called on cooperative _Swap(). The interrupt is always serviced first. Issue: ZEP-2244 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
ef2e463493
commit
ae1a75b82e
9 changed files with 27 additions and 48 deletions
|
@ -42,24 +42,17 @@ GDATA(_kernel)
|
|||
|
||||
SECTION_FUNC(TEXT, __pendsv)
|
||||
|
||||
#if defined (CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH) || \
|
||||
defined(CONFIG_STACK_SENTINEL)
|
||||
#ifdef CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
|
||||
/* Register the context switch */
|
||||
push {lr}
|
||||
|
||||
#ifdef CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
|
||||
bl _sys_k_event_logger_context_switch
|
||||
#endif
|
||||
#ifdef CONFIG_STACK_SENTINEL
|
||||
bl _check_stack_sentinel
|
||||
#endif
|
||||
#if defined(CONFIG_ARMV6_M)
|
||||
pop {r0}
|
||||
mov lr, r0
|
||||
#else
|
||||
pop {lr}
|
||||
#endif /* CONFIG_ARMV6_M */
|
||||
#endif /* CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH || CONFIG_STACK_SENTINEL */
|
||||
#endif /* CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH */
|
||||
|
||||
/* load _kernel into r1 and current k_thread into r2 */
|
||||
ldr r1, =_kernel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue