linux-mips-fnet
[Top] [All Lists]

Re: DECstation: linux-2.1.99 is out!

To: Harald Koerfgen <harald.koerfgen@netcologne.de>
Subject: Re: DECstation: linux-2.1.99 is out!
From: ralf@uni-koblenz.de
Date: Mon, 8 Jun 1998 09:55:23 +0200
Cc: linux-mips@fnet.fr
In-reply-to: <XFMail.980607211403.harald.koerfgen@netcologne.de>; from Harald Koerfgen on Sun, Jun 07, 1998 at 09:14:03PM +0200
References: <XFMail.980602182316.harald.koerfgen@netcologne.de> <XFMail.980607211403.harald.koerfgen@netcologne.de>
On Sun, Jun 07, 1998 at 09:14:03PM +0200, Harald Koerfgen wrote:

> I guess I have found the buglet which prevented the 2.1.99 kernel from 
> executing
> executables from the ramdisk. The patch is so simple that everybody should be 
> able
> to apply it:
> 
> In include/asm-mips/current.h add a 'nop; \' after 'lw reg, 
> %lo(kernelsp)(reg); \' so
> that _GET_CURRENT looks like:
> 
> ===
> 
> #define _GET_CURRENT(reg)                       \    
>         lui     reg, %hi(kernelsp);             \
>         .set    push;                           \
>         .set    noreorder;                      \
>         lw      reg, %lo(kernelsp)(reg);        \
>         nop;                                    \
>         .set    pop;                            \
>         ori     reg, 8191;                      \
>         xori    reg, 8191

Make the ``noreorder'' an ``reorder''.  That way the macro will do the
right thing for for all CPUs and even produce most efficient code.  The
.set push/pop macros which push/pop the state of all .set modifyable assembler
options to/from a stack are useful that macros can be used as a black box
like above.

For the general case, since we want as few nops to fill delay slots, the
best thing to do is to leave reordering enabled where possible.  There is
just a few places where reordering really needs to be disabled because the
assembler wouldn't fill delay slots.  I used to disable reordering in
a lot of older code but it's actually better to make use of the assembler's
capabilities for better and correct code.

  Ralf

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