Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@oss.sgi.com>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: linux-mips@oss.sgi.com
Subject: Re: sti() does not work.
Date: Wed, 4 Jul 2001 15:26:19 +0200	[thread overview]
Message-ID: <20010704152619.E3829@bacchus.dhis.org> (raw)
In-Reply-To: <20010704122329.B30713@rembrandt.csv.ica.uni-stuttgart.de>; from ica2_ts@csv.ica.uni-stuttgart.de on Wed, Jul 04, 2001 at 12:23:29PM +0200

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.

  Ralf

  parent reply	other threads:[~2001-07-05  0:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03 22:48 sti() does not work Steven Liu
2001-07-03 22:48 ` Steven Liu
2001-07-04 10:23 ` Thiemo Seufer
2001-07-04 12:23   ` Gleb O. Raiko
2001-07-04 13:26   ` Ralf Baechle [this message]
2001-07-05 11:35     ` Maciej W. Rozycki
2001-07-13 11:35       ` Ralf Baechle
2001-07-13 14:01         ` Maciej W. Rozycki
2001-07-14 11:04           ` Ralf Baechle
2001-07-14 11:39             ` Kevin D. Kissell
2001-07-14 11:39               ` Kevin D. Kissell
2001-07-16 12:46             ` Maciej W. Rozycki
2001-07-04 13:29 ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010704152619.E3829@bacchus.dhis.org \
    --to=ralf@oss.sgi.com \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox