linux-mips
[Top] [All Lists]

Re: Build failure for R3000 DECstation

To: Jun Sun <jsun@mvista.com>
Subject: Re: Build failure for R3000 DECstation
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Wed, 15 Nov 2000 21:31:41 +0100 (MET)
Cc: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>, linux-mips@oss.sgi.com, Ralf Baechle <ralf@oss.sgi.com>
In-reply-to: <3A12EF72.980C8E92@mvista.com>
Organization: Technical University of Gdansk
Reply-to: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Sender: owner-linux-mips@oss.sgi.com
On Wed, 15 Nov 2000, Jun Sun wrote:

> I did not doubt the non-zero value of k0.  I really doubted the
> approach: a userland primitive is based on non-documented,
> non-guarranteed kernel stack restoring code.  Once something changes in
> kernel, you will get really obscure bugs.

 We need not rely on a non-documented behaviour.  We may clobber k0
explicitly, e.g.:

#define RESTORE_SP_AND_RET                      \
                .set    push;                   \
                .set    noreorder;              \
                lw      k1, PT_EPC(sp);         \
                lw      sp, PT_R29(sp);         \
                nor     k0, zero, zero;         \
                jr      k1;                     \
                 rfe;                           \
                .set    pop

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +



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