[Top] [All Lists]

Re: sti() does not work.

To: Thiemo Seufer <>
Subject: Re: sti() does not work.
From: Ralf Baechle <>
Date: Wed, 4 Jul 2001 15:26:19 +0200
In-reply-to: <>; from on Wed, Jul 04, 2001 at 12:23:29PM +0200
References: <> <>
User-agent: Mutt/1.2.5i
On Wed, Jul 04, 2001 at 12:23:29PM +0200, Thiemo Seufer wrote:

> > extern __inline__ void  __sti(void)
> > {
> >     __asm__ __volatile__(
> >             ".set\tnoreorder\n\t"
> >             ".set\tnoat\n\t"
> >             "mfc0\t$1,$12\n\t"
> >             "ori\t$1,0x1f\n\t"
> >             "xori\t$1,0x1e\n\t"
> >             "mtc0\t$1,$12\n\t"               /* <----- problem  here! */
> Here should follow some nop's on a MIPS I system to make sure $12
> is written

There are no nops there since we simply don't care how how many cycles
after the mtc0 the interrupts actually get enabled.  Worst case is the
R4000's 8 stage pipeline where we have a latency of 3 cycles, clearly
nothing that justifies wasting memory and cycles for nops.

> (why is noreorder used here?).

Without the .set noreorder the assembler would be free to do arbitrary
reordering of the object code generated.  Gas doesn't do that but there
are other assemblers that do flow analysis and may generate object code
that doesn't look very much like the source they were fed with.


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