summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-03-26 15:49:59 -0700
committerKeith Packard <keithp@keithp.com>2016-03-26 16:07:20 -0700
commit6a9546413d6a236c010e806b50506d870961d074 (patch)
tree5456f4ecf8e7af30a13d335689cfbb9774452adb /src
parent55db3b3e8addaa2dc0af50470d3bc8c25cb57df3 (diff)
altos/stm: Run scheduler code on interrupt stack
This provides a bit more room for tasks on their stack Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/stm/ao_arch_funcs.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h
index 42f1a2e5..02b344b1 100644
--- a/src/stm/ao_arch_funcs.h
+++ b/src/stm/ao_arch_funcs.h
@@ -335,6 +335,13 @@ static inline void ao_arch_save_stack(void) {
static inline void ao_arch_restore_stack(void) {
uint32_t sp;
+ uint32_t control;
+
+ asm("mrs %0,control" : "=&r" (control));
+ control |= (1 << 1);
+ asm("msr control,%0" : : "r" (control));
+ asm("isb");
+
sp = (uint32_t) ao_cur_task->sp;
/* Switch stacks */
@@ -375,7 +382,14 @@ static inline void ao_arch_start_scheduler(void) {
}
#endif
-#define ao_arch_isr_stack()
+static inline void ao_arch_isr_stack(void) {
+ uint32_t control;
+
+ asm("mrs %0,control" : "=&r" (control));
+ control &= ~(1 << 1);
+ asm("msr control,%0" : : "r" (control));
+ asm("isb");
+}
#endif