From owner-freebsd-ppc@FreeBSD.ORG Wed Jul 8 13:34:46 2009 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42CF01065670 for ; Wed, 8 Jul 2009 13:34:46 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by mx1.freebsd.org (Postfix) with ESMTP id DB2E08FC12 for ; Wed, 8 Jul 2009 13:34:45 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by yxe11 with SMTP id 11so8113218yxe.3 for ; Wed, 08 Jul 2009 06:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=tx2dg8T7yBMKvAf1L5hG1a/9WcI3Ecr1T2VDcfd85zg=; b=HNGzNmvKnlXWH31FKziagOFMoHS2IW+L47ilju9oN41F6vKJpzrMutRwZbeIknLFx5 cGLXABwycWtNbbflR3HvAFOkBTFayN/A+IcUJ4WhS4gaXSKnE/i56wKp4uzjYmHbDlzj /QTFBxBMrKBiuwBxm4ubIAQFTj9qYuoqE0eyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=RHBA2Ln0pkgvDFsdDE4kg7T5ezZRChk9ZACY3BfDIfKBjeUxP3rvW7urCgtnT0nMRK TnNKlH3fnH3dyPDep/AYq1Uh4Q1ji05WnmSK6GGlH/8x9gptDXnJlS5t9caV3xozW1ml B+Il1hjwhvQpHeRz8BjaIEdnBwsCAju+XjZHY= MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.100.231.8 with SMTP id d8mr12101104anh.196.1247060082518; Wed, 08 Jul 2009 06:34:42 -0700 (PDT) In-Reply-To: <4A538B64.2080506@freebsd.org> References: <4A538B64.2080506@freebsd.org> Date: Wed, 8 Jul 2009 09:34:42 -0400 X-Google-Sender-Auth: 44e055ddc911d39d Message-ID: From: Justin Hibbits To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD PowerPC ML Subject: Re: FreeBSD/ppc ABI 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: Wed, 08 Jul 2009 13:34:46 -0000 On Tue, Jul 7, 2009 at 1:52 PM, Peter Grehan wrote: > Hi Justin, > >> The trick is only needed in user space, as a shim between two >> functions, so I just need any volatile registers that I can use but >> aren't function arguments. =A0The target is G4/G5. =A0I only need 3 or 4 >> volatile registers, but the more the better. > > =A0You'll probably have to use the stack to spill the param register. Hav= e =A0a > look at the MCOUNT macro in ppc's for an example of c= ode > that is an intercept between two routines and has to assume that all para= m > registers are used > > (http://svn.freebsd.org/viewvc/base/head/sys/powerpc/include/profile.h?vi= ew=3Dmarkup&pathrev=3D153813 > is the version that has the code fragment commented). > > later, > > Peter. > Thanks Peter, and Rafal, I think this is just what I need. I can use the 3 volatile registers, and save the parameter registers when I need to call library functions. I'm doing this largely in assembly for performance reasons, but knowing how mcount does it will help for the uncommon case branches. - Justin