Merge pull request #14434 from maribu/irq_cleanup

cpu/cortexm_common: Fix cpu_switch_context_exit()
This commit is contained in:
Martine Lenders 2020-07-04 11:42:54 +02:00 committed by GitHub
commit 60469026cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,15 +265,19 @@ void *thread_isr_stack_start(void)
return (void *)&_sstack; return (void *)&_sstack;
} }
__attribute__((naked)) void NORETURN cpu_switch_context_exit(void) void NORETURN cpu_switch_context_exit(void)
{ {
/* enable IRQs to make sure the SVC interrupt is reachable */
irq_enable();
/* trigger the SVC interrupt */
__asm__ volatile ( __asm__ volatile (
"bl irq_enable \n" /* enable IRQs to make the SVC "svc #1 \n"
* interrupt is reachable */ : /* no outputs */
"svc #1 \n" /* trigger the SVC interrupt */ : /* no inputs */
"unreachable%=: \n" /* this loop is unreachable */ : /* no clobbers */
"b unreachable%= \n" /* loop indefinitely */ );
:::);
UNREACHABLE();
} }
void thread_yield_higher(void) void thread_yield_higher(void)