[Suspend2-devel] Bad EIP value
ncunningham at cyclades.com
Mon Jun 6 20:47:58 UTC 2005
On Tue, 2005-06-07 at 02:01, Johannes Berg wrote:
> Johannes Berg wrote:
> > Yes, perfectly makes sense and should probably be done. However, I can
> > see one problem coming up: What if %ebp is used for other purposes?
> > (Is it supposed to be saved across function calls or not?)
> So I'm perfectly confused now. %ebp is supposed to be non-volatile, but
> gcc apparently treats it as volatile when you omit frame pointers. When
> we have frame pointers, then we luck out because the stack moving
> function is a leaf function (otherwise it'd have to be saved too).
> I don't know the right way to address this problem, sorry.
> Do we know exactly that frame pointers are always generated with
> CONFIG_FRAME_POINTER and never generated when it is off?
How about this for an idea...
We use the save processor state routine to store all the registers. We
then look through what was saved, seeing if each register points to a
value on the stack. If it does, we relocate it to the new stack. Having
done that, we use the restore processor state routine to reload
registers, in the process moving to our new stack.
More information about the TuxOnIce-devel