diff options
| author | Sijmen Woutersen <[email protected]> | 2022-09-25 20:10:11 +0200 |
|---|---|---|
| committer | Sijmen Woutersen <[email protected]> | 2022-11-10 17:39:41 +0100 |
| commit | 6e1120e17e384a04cd3aef58a1467a4a0a862ba5 (patch) | |
| tree | 557458df0822437844cd767f38c47ef0ce423aa0 /embassy-executor/src/arch/riscv32.rs | |
| parent | 059610a8de49ff2d38311f343d3d1a6f8d90a720 (diff) | |
riscv support
Diffstat (limited to 'embassy-executor/src/arch/riscv32.rs')
| -rw-r--r-- | embassy-executor/src/arch/riscv32.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/embassy-executor/src/arch/riscv32.rs b/embassy-executor/src/arch/riscv32.rs index 2a4b006da..e095c0ee0 100644 --- a/embassy-executor/src/arch/riscv32.rs +++ b/embassy-executor/src/arch/riscv32.rs | |||
| @@ -54,20 +54,7 @@ impl Executor { | |||
| 54 | loop { | 54 | loop { |
| 55 | unsafe { | 55 | unsafe { |
| 56 | self.inner.poll(); | 56 | self.inner.poll(); |
| 57 | // we do not care about race conditions between the load and store operations, interrupts | 57 | core::arch::asm!("wfi"); |
| 58 | //will only set this value to true. | ||
| 59 | critical_section::with(|_| { | ||
| 60 | // if there is work to do, loop back to polling | ||
| 61 | // TODO can we relax this? | ||
| 62 | if SIGNAL_WORK_THREAD_MODE.load(Ordering::SeqCst) { | ||
| 63 | SIGNAL_WORK_THREAD_MODE.store(false, Ordering::SeqCst); | ||
| 64 | } | ||
| 65 | // if not, wait for interrupt | ||
| 66 | else { | ||
| 67 | core::arch::asm!("wfi"); | ||
| 68 | } | ||
| 69 | }); | ||
| 70 | // if an interrupt occurred while waiting, it will be serviced here | ||
| 71 | } | 58 | } |
| 72 | } | 59 | } |
| 73 | } | 60 | } |
