From owner-freebsd-ppc@FreeBSD.ORG Fri Jun 3 07:15:32 2005 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2FCB16A41C for ; Fri, 3 Jun 2005 07:15:32 +0000 (GMT) (envelope-from toa@pop.agri.ch) Received: from smtp.messaging.ch (exsmtp02.agrinet.ch [81.221.252.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AA7343D1D for ; Fri, 3 Jun 2005 07:15:32 +0000 (GMT) (envelope-from toa@pop.agri.ch) Received: from EXVS01.mcis.agrinet.local ([81.221.248.1]) by smtp.messaging.ch with Microsoft SMTPSVC(6.0.3790.211); Fri, 3 Jun 2005 09:15:24 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 3 Jun 2005 09:11:34 +0200 Message-ID: <755798E8D0ED7C43B2169A3673E1EB5F59444A@EXVS01.mcis.agrinet.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: calling/runtime convention for ppc fbsd Thread-Index: AcVoCj5Gctem2CLkQtyROXRhx+zvyQAATuDE From: To: , X-OriginalArrivalTime: 03 Jun 2005 07:15:24.0612 (UTC) FILETIME=[02D1B040:01C5680C] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-ppc@freebsd.org Subject: RE: calling/runtime convention for ppc fbsd X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2005 07:15:33 -0000 -----Original Message----- From: David O'Brien [mailto:obrien@freebsd.org] Sent: Fri 6/3/2005 9:02 AM To: peterg@ptree32.com.au Cc: toa@pop.agri.ch; freebsd-ppc@freebsd.org Subject: Re: calling/runtime convention for ppc fbsd =20 On Fri, Jun 03, 2005 at 08:12:33AM +1000, peterg@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. > >>=20 > >> Ok. > > > >Exactly the one above? > > > >I mean, small structures are passed in registers and not per = reference ? >=20 > 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 <=3D 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