[parisc-linux] [Q] how to get the SP from __jmpbuf / glibc

Christian Suder csuder@cisco.com
Sun, 6 Jan 2002 01:01:52 -0800


Hello,

trying to convince an application to compile and run on palinux I have the
following problem:

The application tries to figure out the stackpointer with

(_t)->md.context[0].__jmpbuf[JB_SP]

however bits/setjmp.h defines the jmpbuf as:

typedef double __jmp_buf[21];  

so it returns a double which the compiler doesn't like as pointer. A
couple of questions as I'm a) a lousy programmer and b) couldn't find the
basic information on what the CPU stores how.

Is double used to cover 64 bit support ? Isn't there a better way than to
use a floating point variable ? 

How does the information in the __jmpbuf look like ? I don't think the SP
occupies 64 bit ? Would the lower 32 bit be the SP ? 

Is the SP 32 bit at all ? Or is there any funky alignment or indexing or
whatever going on ? Where can I find that information about the CPU ? 

How do I get the SP from the __jmpbuf ? 

Thanks for bearing with my ignorance,

	Christian