*BSD News Article 14123


Return to BSD News archive

Xref: sserve comp.sys.sun.misc:6856 comp.unix.bsd:11764 comp.unix.wizards:29126 comp.unix.internals:5714
Newsgroups: comp.sys.sun.misc,comp.unix.bsd,comp.unix.wizards,comp.unix.internals
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!wupost!cs.uiuc.edu!sparc0b!neely
From: neely@cs.uiuc.edu (J. Robert Neely)
Subject: Register Windows on the sparc
Message-ID: <C4zvC8.A54@cs.uiuc.edu>
Keywords: sparc, register windows, beer
Sender: news@cs.uiuc.edu
Organization: University of Illinois at Urbana-Champaign
Date: Mon, 5 Apr 1993 05:02:32 GMT
Lines: 29

I have a question regarding register windows on the Sparc.  We're writing
a routine to implement checkpointing, and we need to be able to save the
entire environment and replace it at a later date.

We are able to save the data, heap, and stack, and we're using a 
setjmp/longjmp combination to save the register sets.  However, it
appears that not enough information is being saved so that we can 
simply replace the data (from file) at a later point and continue.
(We get a bus error the first time we try to return from a procedure).
We've determined that the frame pointer is not being restored.

Two problems: 1) the frame pointer doesn't appear to be saved with the
setjmp() (along with a bunch of other registers), and 2) we're not able
to restore the registers in the non-current window.  We attempted to 
use a trap (ST_FLUSH_WINDOWS) which says that it writes these registers
back to their stack slots and marks them invalid, but we're not sure if
this is system stack space or a user stack space which we can save and 
restore. 

Does anybody know the best way to save and restore (after a context 
switch) the complete set of register windows?  We basically need to 
save enough information about the program so that we can restart it
with the exact same state as when it was checkpointed.

Thanks for any help.

--Rob Neely
--neely@cs.uiuc.edu