Context switching on SPARC

sanzgiri at flamingo.metaphor.com sanzgiri at flamingo.metaphor.com
Wed Jul 25 04:43:28 AEST 1990


I'd appreciate help on either or both of the following 2 related
questions: (both about context switching - within a process - on the
SPARC)

1) I'd like to write a piece of code that "fakes" a setjmp call from a
   previously non-existent context. I want to do this so that the
   corresponding longjmp call will branch to a given function pointer and use
   a given pointer as its stack pointer. Doing the "obvious thing" leads to
   segmentation violations, bus errors etc.

2) How does one write a piece of assembly code that will restore an
   arbitrary register state? Again, doing the "obvious thing" leads to
   illegal instruction errors or similar junk.

I am pretty sure the above problems are related to the "windowing"
architecture of the processor - wherein you must not only restore the
given window but its predecessors as well while remaining compatible with
the overflow-underflow processing - in order to switch contexts. But I am
unable to get any meaningful help from either of the SPARC architecture
manual or the Sun-4 assembly language reference manual. Enquiries with Sun
haven't turned anything up yet.

E-mail would be great. (I'll summarise). Posted replies OK too.



More information about the Comp.sys.sun mailing list