[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] what's wrong with this code?



Johan Klockars <johan@klockars.net> writes:

> No stack pointer is ever saved before entering an exception handler, nor 
> restored on RTE.
> There are physically separate registers for the various stack pointers, 
> which just get "remapped" in hardware depending on the bits in SR.

But note that when you toggle the S bit in the saved SR you are returning
to a different stack than before.  If USP and SSP are not properly set up
you can end up overwriting part of the other stack that you need when
switching back.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."