From: Keith Packard Date: Tue, 8 Oct 2013 04:53:53 +0000 (-0700) Subject: altos/lpc, altos/stm: ARM requires ISB after switching stack pointers X-Git-Tag: 1.2.9.4~61 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=8f7edcee2db30652ce0b147f282de3396c3786ad;ds=sidebyside altos/lpc, altos/stm: ARM requires ISB after switching stack pointers This sticks a barrier in the CPU to prevent using the wrong stack register past the change. Signed-off-by: Keith Packard --- diff --git a/src/lpc/ao_arch_funcs.h b/src/lpc/ao_arch_funcs.h index 9a3219a2..0891903e 100644 --- a/src/lpc/ao_arch_funcs.h +++ b/src/lpc/ao_arch_funcs.h @@ -235,6 +235,7 @@ static inline void ao_arch_start_scheduler(void) { asm("mrs %0,control" : "=&r" (control)); control |= (1 << 1); asm("msr control,%0" : : "r" (control)); + asm("isb"); } #endif /* _AO_ARCH_FUNCS_H_ */ diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index 9bb2d7cd..4bcc1023 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -354,6 +354,7 @@ static inline void ao_arch_start_scheduler(void) { asm("mrs %0,control" : "=&r" (control)); control |= (1 << 1); asm("msr control,%0" : : "r" (control)); + asm("isb"); } #endif