Something is wrong w/ prnull's initial stack layout or SP value.
If the first call to resched() occurs from prnull, prnull's SP becomes
corrupt and the next time it is selected for execution the PC will be
somewhere random in memory.
Experimentally, I found that forcing the first call to resched() to
occur from an IRQ handler (timer in the case of the raspberry-pi)
avoids this issue.
Something is wrong w/ prnull's initial stack layout or SP value. If the first call to resched() occurs from prnull, prnull's SP becomes corrupt and the next time it is selected for execution the PC will be somewhere random in memory.
Experimentally, I found that forcing the first call to resched() to occur from an IRQ handler (timer in the case of the raspberry-pi) avoids this issue.