Merge pull request #15086 from maribu/ibs-after-stackpointer

cpu/cortexm_common: Flush pipeline after triggering PendSV
This commit is contained in:
Kaspar Schleiser 2020-09-26 21:05:04 +02:00 committed by GitHub
commit 9334897ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,6 +297,9 @@ void thread_yield_higher(void)
/* trigger the PENDSV interrupt to run scheduler and schedule new thread if
* applicable */
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
/* flush the pipeline. Otherwise we risk that subsequent instructions are
* executed before the IRQ has actually triggered */
__ISB();
}
void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) {