From e0c7a11f6e07357ef5f15d981fca776042861ef1 Mon Sep 17 00:00:00 2001 From: Felix Kopp Date: Mon, 30 Nov 2020 02:33:11 +0100 Subject: [PATCH] sched: Set all required process registers --- arch/at91sam3x8e/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/at91sam3x8e/sched.c b/arch/at91sam3x8e/sched.c index 053770d..24f921a 100644 --- a/arch/at91sam3x8e/sched.c +++ b/arch/at91sam3x8e/sched.c @@ -18,7 +18,7 @@ void irq_sys_tick(void) * because it is faster that way (according to the docs, at least) */ if (!_is_atomic_context) - arch_irq_invoke(IRQNO_PEND_SV); + arch_irq_invoke(IRQNO_PEND_SV); } /** @@ -64,6 +64,8 @@ void arch_sched_process_init(struct process *process, void (*entry)(void)) memset(regs, 0, sizeof(*regs)); regs->hw.pc = entry; + regs->hw.psr = 0x01000000; + regs->sw.lr = 0xFFFFFFF9; } void sched_switch_early(enum proc_state state)