Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2009 09:34:42 -0400
From:      Justin Hibbits <jrh29@alumni.cwru.edu>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: FreeBSD/ppc ABI
Message-ID:  <fd9cd3450907080634g4101ead1ic2bf5694d44e7772@mail.gmail.com>
In-Reply-To: <4A538B64.2080506@freebsd.org>
References:  <fd9cd3450907070641l45223e72p5f7147b97fc5755f@mail.gmail.com> <A07805D6-CAD5-4721-86AC-DE1751831D3C@semihalf.com> <fd9cd3450907071007l5501ea85y81bcb1ee8f4b8bdc@mail.gmail.com> <4A538B64.2080506@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 7, 2009 at 1:52 PM, Peter Grehan<grehan@freebsd.org> 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 <machine/profile.h> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fd9cd3450907080634g4101ead1ic2bf5694d44e7772>