jetcom / xinu-arm

Xinu arm port, for Raspberry Pi
Other
28 stars 32 forks source link

Workaround for possible bug in ctxsw() #13

Closed jnwatts closed 11 years ago

jnwatts commented 11 years ago

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.

jsb2092 commented 11 years ago

Approved