From 4fa71ecf168e275b24534a5a20e3dd4e178c7bbd Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 26 Mar 2016 15:54:24 -0700 Subject: altos/stm: Validate current task SP in interrupt by looking at PSP We use a separate stack pointer for task code, which means we can verify that it is in range in any interrupt handler. This adds checks for the task stack (under #ifdef DEBUG) that run in ao_wakeup as well as at every timer interrupt. Signed-off-by: Keith Packard --- src/stm/ao_timer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/stm/ao_timer.c') diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index 8db62e76..91ede84b 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -41,6 +41,7 @@ volatile __data uint8_t ao_data_count; void stm_systick_isr(void) { + ao_validate_cur_stack(); if (stm_systick.csr & (1 << STM_SYSTICK_CSR_COUNTFLAG)) { ++ao_tick_count; #if HAS_TASK_QUEUE -- cgit v1.2.3