cpu/cortexm_common: flush pipeline after PendSV
https://interrupt.memfault.com/blog/arm-cortex-m-exceptions-and-nvic#pendsv-example
This commit is contained in:
parent
ad9e35c445
commit
304f4ec7d4
@ -297,6 +297,9 @@ void thread_yield_higher(void)
|
|||||||
/* trigger the PENDSV interrupt to run scheduler and schedule new thread if
|
/* trigger the PENDSV interrupt to run scheduler and schedule new thread if
|
||||||
* applicable */
|
* applicable */
|
||||||
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
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) {
|
void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user