riscv: allow interrupts to wake the scheduler #1227
Conversation
|
Also somewhat related: tinygo/src/runtime/arch_tinygoriscv.go Lines 84 to 90 in 04d097f Isn't this blocking forever since we are waiting for an interrupt with interrupts disabled? |
|
No. The interrupt is masked, so it will not run immediately. Instead what happens is the wfi finishes when the interrupt is pending, then interrupts are re-enabled, then the interrupt executes. |
|
@jaddr2line All right but then shouldn't the
Because right now we disable interrupts in the lower individual interrupt enable register: tinygo/src/device/riscv/riscv.go Lines 25 to 37 in 04d097f But maybe I understand this wrong. |
|
Huh. I don't know. |
|
@jaddr2line I will make some tests when I have time, to check if interruptions wake the scheduler as expected. |
08cdfc1
to
6c037d1
|
Please make sure you rebase against |
|
So, I don't think this is actually safe at this point. Right now, the coroutines implementation may end up with a goroutine suspending in the middle of a critical section due to how returns are implemented. In order to make this safe, we need to modify the coroutine task implementation to loop until it is actually fully suspended. |
|
@deadprogram I will do that thanks. @jaddr2line So it should be safe once #1220 gets merged right? |
|
Yeah. Although I should eventually make coroutines work too. |
6c037d1
to
6ecfa38

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

This PR allows interrupts to wake the scheduler for the FE310 and the K210 RISC-V chips.
Depends on #1220