[Top] [All Lists]


To: Ralf Baechle <>
Subject: Re: [RFC]: MD_FALLBACK_FRAME_STATE_FOR macro for darwin PPC
From: David Daney <>
Date: Wed, 21 Jan 2004 12:08:04 -0800
Cc: Andrew Haley <>, Andreas Tobler <>, Geoffrey Keating <>, gcc-patches <>, Andrew Pinski <>, Eric Christopher <>, Richard Henderson <>,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030
Andrew Haley wrote:

David Daney writes:
> Andreas Tobler wrote:
> > > David Daney wrote:
> >
> >
> >> I know next to nothing about PPC ABIs, but are any of these floating > >> point registers?
> >
> >
> > There are, yes.
> >
> >> Are there any call saved FP registers in this ABI? and if so are you > >> restoring them. Although I don't think that the unwinder uses > >> floating point, it seems that restoring call saved FP registers is a > >> good idea if you are not already doing it.
> >
> >
> > Well, here I expect the advise from the experts, I have floats around > > and I may try to restore them.
> >
> > But, I need some guidance here.
> > When I did the MD_FALLBACK_FRAME_STATE_FOR for mips/linux I did not > handle floating point either as the problem did not occur to me until > after I checked in the code. > > However after thinking about it and posting: > > > > I learned that this is a real issue. > > I may be about ready to do some more mips/linux work soon and may > revisit MD_FALLBACK_FRAME_STATE_FOR. Because in its current state it > seems to be incomplete.

You only need to restore what has been saved.  Looking at
/usr/src/linux-2.4/arch/mips/kernel/signal.c, it seems that there is a
call to save_fp_context().  However, this is only executed if
(current->used_math) is set; you mustn't restore any fp registers if
the process hasn't saved the fp state.

There is a field called sc_used_math in the sigcontext struct.  I
think this tells you what you need to know.  But I am not a kernel


Is this all true?

Perhaps you could shed some light on what really needs to be done in the MIPS/linux case.

Also what should be done in the case of mips 4Kc core where there is only software floating point?

David Daney.

<Prev in Thread] Current Thread [Next in Thread>