calling/runtime convention for ppc fbsd

toa at pop.agri.ch toa at pop.agri.ch
Fri Jun 3 00:15:33 PDT 2005


-----Original Message-----
From: David O'Brien [mailto:obrien at freebsd.org]
Sent: Fri 6/3/2005 9:02 AM
To: peterg at ptree32.com.au
Cc: toa at pop.agri.ch; freebsd-ppc at freebsd.org
Subject: Re: calling/runtime convention for ppc fbsd
 
On Fri, Jun 03, 2005 at 08:12:33AM +1000, peterg at ptree32.com.au wrote:
> >>>> which caling / runtime convention does fbsd ppc follow? The sysv4 
> >>>> from SUN dated around september 1995? Or is it another one?
> >>>
> >>>  That's the one.
> >> 
> >> Ok.
> >
> >Exactly the one above?
> >
> >I mean, small structures are passed in registers and not per reference ?
> 
>  I have to say I'm not sure. The FreeBSD gcc config is basically 'sysv4',
> but maybe that's been changed to not do the structure passing as in
> the ABI document.

I believe I saw a mention of GCC had a PPC psABI bug (while trying to get
thru several 1000's of emails).

----
I think I have it:

linux defines DRAFT_V4_STRUCT_RET 1, while fbsd doesn't.

>From rs6000.c:

   The AIX ABI for the RS/6000 specifies that all structures are
   returned in memory.  The Darwin ABI does the same.  The SVR4 ABI
   specifies that structures <= 8 bytes are returned in r3/r4, but a
   draft put them in memory, and GCC used to implement the draft
   instead of the final standard.  Therefore, aix_struct_return
   controls this instead of DEFAULT_ABI; V.4 targets needing backward
   compatibility can change DRAFT_V4_STRUCT_RET to override the
   default, and -m switches get the final word.  See
   rs6000_override_options for more details.

Andreas



More information about the freebsd-ppc mailing list