diff options
| author | Keith Packard <keithp@keithp.com> | 2012-10-25 13:40:54 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-10-26 14:07:04 -0700 | 
| commit | ccf0faa7d26d56deca7928b521d07be40504466a (patch) | |
| tree | a7faa1cc9e2998e8e0754b3af939c030019405e4 /src/stm/ao_arch_funcs.h | |
| parent | 9b978cd467f9128f3069765dd8fbf8abad3459a4 (diff) | |
altos: Leave interrupts disabled while checking for task to run
Otherwise, we run the risk of an interrupt waking a task after we've
decided to idle the CPU.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_arch_funcs.h')
| -rw-r--r-- | src/stm/ao_arch_funcs.h | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index ca451a53..d6ab1465 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -299,8 +299,10 @@ static inline void ao_arch_restore_stack(void) {  #define ao_arch_isr_stack() -#define ao_arch_cpu_idle() do {			\ +#define ao_arch_wait_interrupt() do {			\  		asm(".global ao_idle_loc\n\twfi\nao_idle_loc:");	\ +		ao_arch_release_interrupts();				\ +		ao_arch_block_interrupts();				\  	} while (0)  #define ao_arch_critical(b) do {				\ | 
