linux-mips
[Top] [All Lists]

Re: Is r25 saved across syscalls?

To: "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: Is r25 saved across syscalls?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 11 Sep 2012 10:58:27 +0200
Cc: Rich Felker <dalias@aerifal.cx>, linux-mips@linux-mips.org
In-reply-to: <alpine.LFD.2.00.1209110059580.8926@eddie.linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <20120909193008.GA15157@brightrain.aerifal.cx> <20120910170830.GB24448@linux-mips.org> <20120910172248.GN27715@brightrain.aerifal.cx> <alpine.LFD.2.00.1209110059580.8926@eddie.linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Sep 11, 2012 at 01:29:52AM +0100, Maciej W. Rozycki wrote:

>  Relying on any call-clobbered registers, including $7 to be preserved 
> across a syscall is risky, to say the least, as this is not guaranteed by 
> the syscall ABI.  I do wonder however why we have these instructions to 
> save/restore $25 in SAVE_SOME/RESTORE_SOME.  This dates back to 2.4 at the 
> very least.
> 
>  Ralf, any insights?

It dates back to the initial commit in 36ea5120 from March 27, 1998 for
2.1.90 when for the sake of better lmbench syscall latency numbers I had
introduced the concept of partial saving of a register frame.  I think it
should rather have been in SAVE_TEMP/RESTORE_TEMP instead.

  Ralf

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