Ticket #424 (Fixed)Fri Apr 22 12:55:26 UTC 2016
Issuing OS_Byte 19 from an IRQ handler is dangerous
Reported by: | Jeffrey Lee (213) | Severity: | Normal |
Part: | RISC OS: General | Release: | |
Milestone: | Status | Fixed |
Details by Jeffrey Lee (213):
If a GraphicsV driver is relying on RTSupport to generate VSync events, issuing OS_Byte 19 from an IRQ handler will deadlock the machine due to IRQ handlers having higher priority than RTSupport threads.
It’s also possible this could deadlock standard IRQ-based GraphicsV drivers, if e.g. the driver masks its interrupt, enables interrupts in the PSR, and is then pre-empted by another IRQ handler before it’s able to issue the VSync event.
Suggested fix is to make OS_Byte 19 return immediately if called from an IRQ context (doing blocking operations from IRQ is bad form anyway). Any code which actually needs VSync synchronisation (e.g. Hourglass module) can be changed to e.g. listen for the VSync event from EventV instead.
Relevant forum thread:
Changelog:
Modified by Jeffrey Lee (213) Fri, April 22 2016 - 12:56:16 GMT
Oops; wrong thread link. This is the right one: https://www.riscosopen.org/forum/forums/4/topic…
Modified by Jeffrey Lee (213) Wed, February 12 2020 - 12:48:56 GMT
- Status changed from Open to Fixed
Fixed in Kernel 6.33 – OS_Byte 19 will return immediately if called from an interrupt handler