[Top] [All Lists]

Re: Timer setup code for DS5000/200

Subject: Re: Timer setup code for DS5000/200
From: Systemkennung Linux <>
Date: Wed, 4 Dec 1996 14:23:38 +0100 (MET)
In-reply-to: <> from "Paul Antoine" at Dec 4, 96 06:25:59 pm
Hi all,

> > NESTED(except_vec3, 0, sp)
> >     .set    noat
> > 
> >     SAVE_ALL
> > 
> >     lw      t0, jiffies
> >     add     t0, 1
> >     sw      t0, jiffies

> sequence above, try:
>       la      k0,jiffies
>       lw      k1,(k0)
>       addiu   k1,1
>       sw      k1,(k0)
> ...which seems correct to me, but still doesn't make them jiffies jump
> the way I think it should... <sigh>  Maybe I've been away from MIPS
> assembler too long...

The problem might be that you're assembling that code in noreorder mode.
In that case there will be no nop be inserted after the lw instruction
and the effect of the addiu is undefined.

This will assemble into the shortest code for all CPUs:

        .set    push
        .set    reorder
        lui     k0,%hi(jiffies)
        lw      k1,%lo(jiffies)(k0)
        addiu   k1,1
        sw      k1,%lo(jiffies)(k0)
        .set    pop

> The BogoMips will only print if the console driver is working, unless

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