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;
}
__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 (
"bl irq_enable \n" /* enable IRQs to make the SVC
* interrupt is reachable */
"svc #1 \n" /* trigger the SVC interrupt */
"unreachable%=: \n" /* this loop is unreachable */
"b unreachable%= \n" /* loop indefinitely */
:::);
"svc #1 \n"
: /* no outputs */
: /* no inputs */
: /* no clobbers */
);
UNREACHABLE();
}
void thread_yield_higher(void)