Re: pa-risc/linux abi
> > Can you confirm that Linux uses HP's 32 bit ABI (i.e., which registers
> > are used in argument passing, and how the stack frame works)? My
>
> Debian hppa is 32 bit -- will forward the rest of this to the experts.
>
> > assembly kernel works under HP-UX, and I'm wondering if it will under
> > linux. The document I used to write it I found on the linux site, but
> > it's an HP doc:
> > http://ftp.parisc-linux.org/docs/arch/rad_11_0_32.pdf
I wrote some comments for the 32-bit calling convention (64-bit is
somewhat similar) for libffi.
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/src/pa/ffi.c?rev=1.1&content-type=text/x-cvsweb-markup
/* PA has a downward growing stack, which looks like this:
Offset
[ Variable args ]
SP = (4*(n+9)) arg word N
...
SP-52 arg word 4
[ Fixed args ]
SP-48 arg word 3
SP-44 arg word 2
SP-40 arg word 1
SP-36 arg word 0
[ Frame marker ]
...
SP-20 RP
SP-4 previous SP
First 4 non-FP 32-bit args are passed in gr26, gr25, gr24 and gr23
First 2 non-FP 64-bit args are passed in register pairs, starting
on an even numbered register (i.e. r26/r25 and r24+r23)
First 4 FP 32-bit arguments are passed in fr4L, fr5L, fr6L and fr7L
First 2 FP 64-bit arguments are passed in fr5 and fr7
The rest are passed on the stack starting at SP-52, but 64-bit
arguments need to be aligned to an 8-byte boundary
This means we can have holes either in the register allocation,
or in the stack. */
randolph
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
Reply to: