Check %sp too in dispatcher for stack overflow
A multi-threaded-style OS for the Spectrum +3
Brought to you by:
u6c87
Whilst messing around with SHA512 code, I blew out the stack, but it was only detected when the redzone byte happened to be overwritten. The kernel should check %sp as well, ensuring it is bounded between t_stkbase and t_stklim. At least then we get a panic closer to the point where we left the stack area for that thread.
Diff:
Actually, it turned out that I was overflowing the results buffer and therefore corrupting lower down the stack, particularly the function return address, and corruption ensued from there onwards. I'm going to shelve this as a "nice to have" for now, as it adds more to the dispatcher codepath during context switch.