From: Daniel Jacobowitz <drow@false.org>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: gdb-patches@sourceware.org, Chris Dearman <chris@mips.com>,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: MIPS: Handle the DSP registers
Date: Tue, 18 Dec 2007 13:42:00 -0000 [thread overview]
Message-ID: <20071218004304.GA29420@caradoc.them.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0712101513270.8746@perivale.mips.com>
On Mon, Dec 10, 2007 at 03:51:55PM +0000, Maciej W. Rozycki wrote:
> Hello,
>
> Here is code to support DSP registers as defined by the DSP ASE to the
> MIPS Architecture. This piece of code handles Linux and provides for
> adding such support to embedded targets. The ASE is optional (as are all
> ASEs) and therefore some steps have been taken to handle this correctly.
>
> In particular, ptrace() calls may return a failure when called on a
> system that does not support the ASE. In such a case the registers are
> marked as unavailable in the cache which has the effect of them being
> hardwired to zero (I have a patch in the queue that would mark them
> specially in the output; I will submit it later).
We have an even better way to handle this, nowadays. Take a look at
arm-linux-nat.c:arm_linux_read_description. This lets the registers
be completely hidden when they are not available.
> +/* Names of Linux registers. */
> +static const char *mips_linux_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
> + "sr", "lo", "hi", "bad", "cause", "pc",
> + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
> + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
> + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
> + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
> + "fsr", "fir", "hi1", "lo1", "hi2", "lo2", "hi3", "lo3",
> + "dspctl",
> +};
If you're using a target description wherever you support these
registers, then you shouldn't need another copy of them here.
> @@ -5270,11 +5341,11 @@
>
>
> valid_p &= tdesc_numbered_register (feature, tdesc_data,
> - MIPS_EMBED_LO_REGNUM, "lo");
> + mips_regnum.lo, "lo");
I went to a bit of trouble to be able to use constants here, please
don't go back the other direction. When all the raw registers use
constant numbering, it's much easier to manage the GDB backend.
> + if (mips_regnum.dspacc >= 0)
> + {
> + feature = tdesc_find_feature (info.target_desc,
> + "org.gnu.gdb.mips.dsp");
Please add this to the manual section describing MIPS target features.
> Index: binutils-quilt/src/gdb/inf-ptrace.c
> ===================================================================
> --- binutils-quilt.orig/src/gdb/inf-ptrace.c 2007-12-07 15:08:21.000000000 +0000
> +++ binutils-quilt/src/gdb/inf-ptrace.c 2007-12-07 15:13:02.000000000 +0000
Using a target description that accurately describes the target should
eliminate the need for these.
> Index: binutils-quilt/src/gdb/features/mips-linux.xml
> ===================================================================
> --- binutils-quilt.orig/src/gdb/features/mips-linux.xml 2007-12-07 15:08:21.000000000 +0000
> +++ binutils-quilt/src/gdb/features/mips-linux.xml 2007-12-07 15:13:02.000000000 +0000
> @@ -11,6 +11,7 @@
> <xi:include href="mips-cpu.xml"/>
> <xi:include href="mips-cp0.xml"/>
> <xi:include href="mips-fpu.xml"/>
> + <xi:include href="mips-dsp.xml"/>
And a corrolary of that is that we'll have two mips-linux
descriptions, with and without the DSP registers.
> Index: binutils-quilt/src/gdb/testsuite/gdb.xml/tdesc-regs.exp
> ===================================================================
> --- binutils-quilt.orig/src/gdb/testsuite/gdb.xml/tdesc-regs.exp 2007-12-07 17:01:40.000000000 +0000
> +++ binutils-quilt/src/gdb/testsuite/gdb.xml/tdesc-regs.exp 2007-12-07 17:02:17.000000000 +0000
> @@ -33,7 +33,7 @@
> set core-regs {arm-core.xml}
> }
> "mips*-*-*" {
> - set core-regs {mips-cpu.xml mips-cp0.xml mips-fpu.xml}
> + set core-regs {mips-cpu.xml mips-cp0.xml mips-fpu.xml mips-dsp.xml}
> }
> "powerpc*-*-*" {
> set regdir "rs6000/"
No need for this, since a MIPS target without the DSP registers is
still valid.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-12-18 0:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-10 16:33 Maciej W. Rozycki
2007-12-18 13:42 ` Daniel Jacobowitz [this message]
2007-12-18 13:56 ` Nigel Stephens
2007-12-18 15:15 ` Daniel Jacobowitz
2007-12-18 16:06 ` Nigel Stephens
2008-03-19 17:07 ` Maciej W. Rozycki
2008-03-21 18:44 ` Daniel Jacobowitz
2008-03-26 16:59 ` Maciej W. Rozycki
2008-03-26 17:59 ` Daniel Jacobowitz
2008-03-27 17:13 ` Maciej W. Rozycki
2008-03-27 17:46 ` Daniel Jacobowitz
2008-03-28 17:16 ` Maciej W. Rozycki
2008-03-31 10:50 ` Maciej W. Rozycki
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=20071218004304.GA29420@caradoc.them.org \
--to=drow@false.org \
--cc=chris@mips.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@linux-mips.org \
--cc=macro@mips.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