From: Matthew Wilcox <matthew@wil.cx>
To: parisc-linux@parisc-linux.org
Subject: [parisc-linux] Space registers and how to use them
Date: Sat, 24 Sep 2005 21:43:42 -0600 [thread overview]
Message-ID: <20050925034342.GA1459@parisc-linux.org> (raw)
There's a certain amount of confusion about how space registers are
specified, so I'm going to explain it for posterity.
There are two types of instruction which reference memory; those with
2-bit 's' fields and those with 3-bit 's' fields.
Instructions with a 3-bit s field are straightforward. The value of
the s field directly specifies which of the 8 space registers to use.
Instructions with a 2-bit s field have two cases. If s is 1-3, we use
the corresponding space register (sr1-sr3). If the value in the s field
is 0, we do not use space register 0. Instead, we use one of sr4-7 as
determined by the top two bits of the *base register*.
In Linux, sr4-7 are always set to the same value. When in kernel space,
they are 0. In user space, they have the value for the task we're
currently executing.
What we were trying to do in pacache.S was use an instruction (flush
instruction cache) as if it were a 2-bit-s instruction when it's actually
a 3-bit-s instruction. This led to the processor using sr0 instead of
one of sr4-7. The assembler now errors on this case, causing us to find
a bug.
Just to make things harder, there is a 2-bit-s version of flush
instruction cache, but it's only available on pa2.0 processors, so we
don't want to use it. Instead we use sr4 (since sr4-7 all have the same
value in Linux).
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next reply other threads:[~2005-09-25 3:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-25 3:43 Matthew Wilcox [this message]
[not found] ` <43367383.6030307@tiscali.be>
2005-09-25 17:35 ` [parisc-linux] Space registers and how to use them Grant Grundler
2005-09-25 18:03 ` John David Anglin
2005-10-06 4:59 ` Grant Grundler
2005-09-25 17:43 ` John David Anglin
2005-09-25 18:17 ` Matthew Wilcox
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=20050925034342.GA1459@parisc-linux.org \
--to=matthew@wil.cx \
--cc=parisc-linux@parisc-linux.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.