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:
Andrew Boie 2017-06-07 09:33:16 -07:00 committed by Maureen Helm
commit ae1a75b82e
9 changed files with 27 additions and 48 deletions

View file

@ -31,9 +31,6 @@ extern void _update_time_slice_before_swap(void);
extern s32_t _ms_to_ticks(s32_t ms);
#endif
extern void idle(void *, void *, void *);
#ifdef CONFIG_STACK_SENTINEL
extern void _check_stack_sentinel(void);
#endif
/* find which one is the next thread to run */
/* must be called with interrupts locked */