All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Marvin <jsm@udlkern.fc.hp.com>
To: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] Re: fic problem
Date: Fri, 13 Dec 2002 06:42:40 -0700 (MST)	[thread overview]
Message-ID: <200212131342.GAA14970@udlkern.fc.hp.com> (raw)

>               __asm__ __volatile__("fic (%0)" :: "r" (spot) );

The assembler should not allow this, but it does. The problem is that
whoever wrote the assembly/disassembly support for parisc didn't really
understand the difference between instructions with 2 bit s fields and
3 bit s fields. fdc has a 2 bit s field, so when you specify "fdc (%0)"
it puts a 0 in the s field, which tells the processor to use the space
registers associated with the top two bits of the address (sr4-sr7). But
if you disassemble the instruction it will print "fdc (sr0,<register>),
which is incorrect, since sr0 is not involved.

fic has a 3 bit s field. In that case, the space register must be specified
explicitly. specifying "fic (%0)" should be illegal. But instead the
assembler just puts a zero in the s field of the instruction. But in this
case it does mean to use sr0. So when you specify "fic (%0)", you are
really specifying "fic (sr0,%0)". Since sr0 is a scratch space register,
you probably have not set it to anything appropriate, so that is probably
why the fic instruction is segfaulting on you (assuming "spot" is a legal
address in your address space).

On parisc linux we use a linear, non segmented address space, so all four
quadrants of the address space are in the same parisc space. That means
that sr4 through sr7 are set to the same value while running in user space.
So, you should change your call to fic to use any of those 4 space registers.
The general convention has been to use sr7. So instead of specifying
"fic (%0)", you should specify "fic (sr7,%0)".

John Marvin
jsm@fc.hp.com

                 reply	other threads:[~2002-12-13 13:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200212131342.GAA14970@udlkern.fc.hp.com \
    --to=jsm@udlkern.fc.hp.com \
    --cc=parisc-linux@lists.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.