diff mbox

[05/24] MIPS: Add config5 to MIPS GDB target descriptions

Message ID 1467038991-6600-5-git-send-email-bhushan.attarde@imgtec.com
State New
Headers show

Commit Message

Bhushan Attarde June 27, 2016, 2:49 p.m. UTC
Add the config5 register to the MIPS and MIPS64 GDB target description
    files and regenerate various dependent files. This register contains the
    FRE bit which is used with the FR bit in the status register to implement
    a new floating point register mode.

    The register is placed with the other cp0 registers at register number 38
    (which used to be the first FP register number). The explicit FPU and DSP
    register numbers are removed so that they can all shuffle up by one to
    give space for config5. The explicit FPU register number used to be
    necessary due to the PC register being defined non-linearly at register
    number 37, but the explicit DSP register numbers didn't seem to serve a
    particular purpose as far as I can tell.

    An corresponding -1 entry is added to mips_base_regs in
    gdbserver/linux-mips-low.c for config5, indicating that it cannot be
    accessed using PTRACE_PEEK/PTRACE_POKE.

    gdb/ChangeLog:

    	* features/mips-cp0.xml: Add config5 register.
    	* features/mips64-cp0.xml: Likewise.
    	* features/mips-fpu.xml: Remove explicit register number.
    	* features/mips64-fpu.xml: Likewise.
    	* features/mips-dsp.xml: Remove explicit register numbers.
    	* features/mips64-dsp.xml: Likewise.
    	* features/mips-dsp-linux.c: Regenerate.
    	* features/mips64-dsp-linux.c: Likewise.
    	* features/mips-linux.c: Likewise.
    	* features/mips64-linux.c: Likewise.
    	* regformats/mips-dsp-linux.dat: Regenerate.
    	* regformats/mips64-dsp-linux.dat: Likewise.
    	* regformats/mips-linux.dat: Likewise.
    	* regformats/mips64-linux.dat: Likewise.

    gdb/gdbserver/ChangeLog:

    	* linux-mips-low.c (mips_num_regs, mips_dsp_num_regs): Increment.
    	(mips_base_regs): Add -1 entry for Config5.
---
 gdb/features/mips-cp0.xml           |  1 +
 gdb/features/mips-dsp-linux.c       | 85 +++++++++++++++++++------------------
 gdb/features/mips-dsp.xml           | 14 +++---
 gdb/features/mips-fpu.xml           |  2 +-
 gdb/features/mips-linux.c           | 71 ++++++++++++++++---------------
 gdb/features/mips64-cp0.xml         |  1 +
 gdb/features/mips64-dsp-linux.c     | 85 +++++++++++++++++++------------------
 gdb/features/mips64-dsp.xml         | 14 +++---
 gdb/features/mips64-fpu.xml         |  2 +-
 gdb/features/mips64-linux.c         | 71 ++++++++++++++++---------------
 gdb/gdbserver/linux-mips-low.c      |  6 +--
 gdb/regformats/mips-dsp-linux.dat   |  1 +
 gdb/regformats/mips-linux.dat       |  1 +
 gdb/regformats/mips64-dsp-linux.dat |  1 +
 gdb/regformats/mips64-linux.dat     |  1 +
 15 files changed, 183 insertions(+), 173 deletions(-)
diff mbox

Patch

diff --git a/gdb/features/mips-cp0.xml b/gdb/features/mips-cp0.xml
index 773fd88..349672e 100644
--- a/gdb/features/mips-cp0.xml
+++ b/gdb/features/mips-cp0.xml
@@ -10,4 +10,5 @@ 
   <reg name="status" bitsize="32" regnum="32"/>
   <reg name="badvaddr" bitsize="32" regnum="35"/>
   <reg name="cause" bitsize="32" regnum="36"/>
+  <reg name="config5" bitsize="32" regnum="38"/>
 </feature>
diff --git a/gdb/features/mips-dsp-linux.c b/gdb/features/mips-dsp-linux.c
index 80ceb22..b6e56fc 100644
--- a/gdb/features/mips-dsp-linux.c
+++ b/gdb/features/mips-dsp-linux.c
@@ -57,54 +57,55 @@  initialize_tdesc_mips_dsp_linux (void)
   tdesc_create_reg (feature, "status", 32, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "badvaddr", 35, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "cause", 36, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "config5", 38, 1, NULL, 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.fpu");
-  tdesc_create_reg (feature, "f0", 38, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f1", 39, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f2", 40, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f3", 41, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f4", 42, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f5", 43, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f6", 44, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f7", 45, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f8", 46, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f9", 47, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f10", 48, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f11", 49, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f12", 50, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f13", 51, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f14", 52, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f15", 53, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f16", 54, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f17", 55, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f18", 56, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f19", 57, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f20", 58, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f21", 59, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f22", 60, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f23", 61, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f24", 62, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f25", 63, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f26", 64, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f27", 65, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f28", 66, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f29", 67, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f30", 68, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f31", 69, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "fcsr", 70, 1, "float", 32, "int");
-  tdesc_create_reg (feature, "fir", 71, 1, "float", 32, "int");
+  tdesc_create_reg (feature, "f0", 39, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f1", 40, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f2", 41, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f3", 42, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f4", 43, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f5", 44, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f6", 45, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f7", 46, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f8", 47, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f9", 48, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f10", 49, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f11", 50, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f12", 51, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f13", 52, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f14", 53, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f15", 54, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f16", 55, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f17", 56, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f18", 57, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f19", 58, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f20", 59, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f21", 60, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f22", 61, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f23", 62, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f24", 63, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f25", 64, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f26", 65, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f27", 66, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f28", 67, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f29", 68, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f30", 69, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f31", 70, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "fcsr", 71, 1, "float", 32, "int");
+  tdesc_create_reg (feature, "fir", 72, 1, "float", 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.dsp");
-  tdesc_create_reg (feature, "hi1", 72, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "lo1", 73, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "hi2", 74, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "lo2", 75, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "hi3", 76, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "lo3", 77, 1, NULL, 32, "int");
-  tdesc_create_reg (feature, "dspctl", 78, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "hi1", 73, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "lo1", 74, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "hi2", 75, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "lo2", 76, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "hi3", 77, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "lo3", 78, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "dspctl", 79, 1, NULL, 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.linux");
-  tdesc_create_reg (feature, "restart", 79, 1, "system", 32, "int");
+  tdesc_create_reg (feature, "restart", 80, 1, "system", 32, "int");
 
   tdesc_mips_dsp_linux = result;
 }
diff --git a/gdb/features/mips-dsp.xml b/gdb/features/mips-dsp.xml
index f8b7e74..fcc903d 100644
--- a/gdb/features/mips-dsp.xml
+++ b/gdb/features/mips-dsp.xml
@@ -7,12 +7,12 @@ 
 
 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
 <feature name="org.gnu.gdb.mips.dsp">
-  <reg name="hi1" bitsize="32" regnum="72"/>
-  <reg name="lo1" bitsize="32" regnum="73"/>
-  <reg name="hi2" bitsize="32" regnum="74"/>
-  <reg name="lo2" bitsize="32" regnum="75"/>
-  <reg name="hi3" bitsize="32" regnum="76"/>
-  <reg name="lo3" bitsize="32" regnum="77"/>
+  <reg name="hi1" bitsize="32"/>
+  <reg name="lo1" bitsize="32"/>
+  <reg name="hi2" bitsize="32"/>
+  <reg name="lo2" bitsize="32"/>
+  <reg name="hi3" bitsize="32"/>
+  <reg name="lo3" bitsize="32"/>
 
-  <reg name="dspctl" bitsize="32" regnum="78"/>
+  <reg name="dspctl" bitsize="32"/>
 </feature>
diff --git a/gdb/features/mips-fpu.xml b/gdb/features/mips-fpu.xml
index 4d331a1..44c4150 100644
--- a/gdb/features/mips-fpu.xml
+++ b/gdb/features/mips-fpu.xml
@@ -7,7 +7,7 @@ 
 
 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
 <feature name="org.gnu.gdb.mips.fpu">
-  <reg name="f0" bitsize="32" type="ieee_single" regnum="38"/>
+  <reg name="f0" bitsize="32" type="ieee_single"/>
   <reg name="f1" bitsize="32" type="ieee_single"/>
   <reg name="f2" bitsize="32" type="ieee_single"/>
   <reg name="f3" bitsize="32" type="ieee_single"/>
diff --git a/gdb/features/mips-linux.c b/gdb/features/mips-linux.c
index c990119..f316835 100644
--- a/gdb/features/mips-linux.c
+++ b/gdb/features/mips-linux.c
@@ -57,45 +57,46 @@  initialize_tdesc_mips_linux (void)
   tdesc_create_reg (feature, "status", 32, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "badvaddr", 35, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "cause", 36, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "config5", 38, 1, NULL, 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.fpu");
-  tdesc_create_reg (feature, "f0", 38, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f1", 39, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f2", 40, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f3", 41, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f4", 42, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f5", 43, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f6", 44, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f7", 45, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f8", 46, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f9", 47, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f10", 48, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f11", 49, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f12", 50, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f13", 51, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f14", 52, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f15", 53, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f16", 54, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f17", 55, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f18", 56, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f19", 57, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f20", 58, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f21", 59, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f22", 60, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f23", 61, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f24", 62, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f25", 63, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f26", 64, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f27", 65, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f28", 66, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f29", 67, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f30", 68, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "f31", 69, 1, NULL, 32, "ieee_single");
-  tdesc_create_reg (feature, "fcsr", 70, 1, "float", 32, "int");
-  tdesc_create_reg (feature, "fir", 71, 1, "float", 32, "int");
+  tdesc_create_reg (feature, "f0", 39, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f1", 40, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f2", 41, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f3", 42, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f4", 43, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f5", 44, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f6", 45, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f7", 46, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f8", 47, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f9", 48, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f10", 49, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f11", 50, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f12", 51, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f13", 52, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f14", 53, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f15", 54, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f16", 55, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f17", 56, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f18", 57, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f19", 58, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f20", 59, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f21", 60, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f22", 61, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f23", 62, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f24", 63, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f25", 64, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f26", 65, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f27", 66, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f28", 67, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f29", 68, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f30", 69, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "f31", 70, 1, NULL, 32, "ieee_single");
+  tdesc_create_reg (feature, "fcsr", 71, 1, "float", 32, "int");
+  tdesc_create_reg (feature, "fir", 72, 1, "float", 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.linux");
-  tdesc_create_reg (feature, "restart", 72, 1, "system", 32, "int");
+  tdesc_create_reg (feature, "restart", 73, 1, "system", 32, "int");
 
   tdesc_mips_linux = result;
 }
diff --git a/gdb/features/mips64-cp0.xml b/gdb/features/mips64-cp0.xml
index 7d20cf9..d1249f4 100644
--- a/gdb/features/mips64-cp0.xml
+++ b/gdb/features/mips64-cp0.xml
@@ -10,4 +10,5 @@ 
   <reg name="status" bitsize="64" regnum="32"/>
   <reg name="badvaddr" bitsize="64" regnum="35"/>
   <reg name="cause" bitsize="64" regnum="36"/>
+  <reg name="config5" bitsize="64" regnum="38"/>
 </feature>
diff --git a/gdb/features/mips64-dsp-linux.c b/gdb/features/mips64-dsp-linux.c
index bc09078..f75cbd7 100644
--- a/gdb/features/mips64-dsp-linux.c
+++ b/gdb/features/mips64-dsp-linux.c
@@ -55,54 +55,55 @@  initialize_tdesc_mips64_dsp_linux (void)
   tdesc_create_reg (feature, "status", 32, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "badvaddr", 35, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "cause", 36, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "config5", 38, 1, NULL, 64, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.fpu");
-  tdesc_create_reg (feature, "f0", 38, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f1", 39, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f2", 40, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f3", 41, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f4", 42, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f5", 43, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f6", 44, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f7", 45, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f8", 46, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f9", 47, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f10", 48, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f11", 49, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f12", 50, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f13", 51, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f14", 52, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f15", 53, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f16", 54, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f17", 55, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f18", 56, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f19", 57, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f20", 58, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f21", 59, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f22", 60, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f23", 61, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f24", 62, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f25", 63, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f26", 64, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f27", 65, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f28", 66, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f29", 67, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f30", 68, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f31", 69, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "fcsr", 70, 1, "float", 64, "int");
-  tdesc_create_reg (feature, "fir", 71, 1, "float", 64, "int");
+  tdesc_create_reg (feature, "f0", 39, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f1", 40, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f2", 41, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f3", 42, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f4", 43, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f5", 44, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f6", 45, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f7", 46, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f8", 47, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f9", 48, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f10", 49, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f11", 50, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f12", 51, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f13", 52, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f14", 53, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f15", 54, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f16", 55, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f17", 56, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f18", 57, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f19", 58, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f20", 59, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f21", 60, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f22", 61, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f23", 62, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f24", 63, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f25", 64, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f26", 65, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f27", 66, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f28", 67, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f29", 68, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f30", 69, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f31", 70, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fcsr", 71, 1, "float", 64, "int");
+  tdesc_create_reg (feature, "fir", 72, 1, "float", 64, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.dsp");
-  tdesc_create_reg (feature, "hi1", 72, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "lo1", 73, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "hi2", 74, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "lo2", 75, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "hi3", 76, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "lo3", 77, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "dspctl", 78, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "hi1", 73, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "lo1", 74, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "hi2", 75, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "lo2", 76, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "hi3", 77, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "lo3", 78, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "dspctl", 79, 1, NULL, 32, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.linux");
-  tdesc_create_reg (feature, "restart", 79, 1, "system", 64, "int");
+  tdesc_create_reg (feature, "restart", 80, 1, "system", 64, "int");
 
   tdesc_mips64_dsp_linux = result;
 }
diff --git a/gdb/features/mips64-dsp.xml b/gdb/features/mips64-dsp.xml
index 0a2694e..a627276 100644
--- a/gdb/features/mips64-dsp.xml
+++ b/gdb/features/mips64-dsp.xml
@@ -7,12 +7,12 @@ 
 
 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
 <feature name="org.gnu.gdb.mips.dsp">
-  <reg name="hi1" bitsize="64" regnum="72"/>
-  <reg name="lo1" bitsize="64" regnum="73"/>
-  <reg name="hi2" bitsize="64" regnum="74"/>
-  <reg name="lo2" bitsize="64" regnum="75"/>
-  <reg name="hi3" bitsize="64" regnum="76"/>
-  <reg name="lo3" bitsize="64" regnum="77"/>
+  <reg name="hi1" bitsize="64"/>
+  <reg name="lo1" bitsize="64"/>
+  <reg name="hi2" bitsize="64"/>
+  <reg name="lo2" bitsize="64"/>
+  <reg name="hi3" bitsize="64"/>
+  <reg name="lo3" bitsize="64"/>
 
-  <reg name="dspctl" bitsize="32" regnum="78"/>
+  <reg name="dspctl" bitsize="32"/>
 </feature>
diff --git a/gdb/features/mips64-fpu.xml b/gdb/features/mips64-fpu.xml
index 7596fec..60b194a 100644
--- a/gdb/features/mips64-fpu.xml
+++ b/gdb/features/mips64-fpu.xml
@@ -7,7 +7,7 @@ 
 
 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
 <feature name="org.gnu.gdb.mips.fpu">
-  <reg name="f0" bitsize="64" type="ieee_double" regnum="38"/>
+  <reg name="f0" bitsize="64" type="ieee_double"/>
   <reg name="f1" bitsize="64" type="ieee_double"/>
   <reg name="f2" bitsize="64" type="ieee_double"/>
   <reg name="f3" bitsize="64" type="ieee_double"/>
diff --git a/gdb/features/mips64-linux.c b/gdb/features/mips64-linux.c
index 2ecda9b..0c9331b 100644
--- a/gdb/features/mips64-linux.c
+++ b/gdb/features/mips64-linux.c
@@ -55,45 +55,46 @@  initialize_tdesc_mips64_linux (void)
   tdesc_create_reg (feature, "status", 32, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "badvaddr", 35, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "cause", 36, 1, NULL, 64, "int");
+  tdesc_create_reg (feature, "config5", 38, 1, NULL, 64, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.fpu");
-  tdesc_create_reg (feature, "f0", 38, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f1", 39, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f2", 40, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f3", 41, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f4", 42, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f5", 43, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f6", 44, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f7", 45, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f8", 46, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f9", 47, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f10", 48, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f11", 49, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f12", 50, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f13", 51, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f14", 52, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f15", 53, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f16", 54, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f17", 55, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f18", 56, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f19", 57, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f20", 58, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f21", 59, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f22", 60, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f23", 61, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f24", 62, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f25", 63, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f26", 64, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f27", 65, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f28", 66, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f29", 67, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f30", 68, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "f31", 69, 1, NULL, 64, "ieee_double");
-  tdesc_create_reg (feature, "fcsr", 70, 1, "float", 64, "int");
-  tdesc_create_reg (feature, "fir", 71, 1, "float", 64, "int");
+  tdesc_create_reg (feature, "f0", 39, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f1", 40, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f2", 41, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f3", 42, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f4", 43, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f5", 44, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f6", 45, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f7", 46, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f8", 47, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f9", 48, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f10", 49, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f11", 50, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f12", 51, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f13", 52, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f14", 53, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f15", 54, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f16", 55, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f17", 56, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f18", 57, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f19", 58, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f20", 59, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f21", 60, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f22", 61, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f23", 62, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f24", 63, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f25", 64, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f26", 65, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f27", 66, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f28", 67, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f29", 68, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f30", 69, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "f31", 70, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fcsr", 71, 1, "float", 64, "int");
+  tdesc_create_reg (feature, "fir", 72, 1, "float", 64, "int");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.linux");
-  tdesc_create_reg (feature, "restart", 72, 1, "system", 64, "int");
+  tdesc_create_reg (feature, "restart", 73, 1, "system", 64, "int");
 
   tdesc_mips64_linux = result;
 }
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 30a03d5..e9f0b06 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -54,8 +54,8 @@  extern const struct target_desc *tdesc_mips64_dsp_linux;
 #include <sys/reg.h>
 #endif
 
-#define mips_num_regs 73
-#define mips_dsp_num_regs 80
+#define mips_num_regs 74
+#define mips_dsp_num_regs 81
 
 #include <asm/ptrace.h>
 
@@ -81,7 +81,7 @@  union mips_register
   16, 17, 18, 19, 20, 21, 22, 23,					\
   24, 25, 26, 27, 28, 29, 30, 31,					\
 									\
-  -1, MMLO, MMHI, BADVADDR, CAUSE, PC,					\
+  -1, MMLO, MMHI, BADVADDR, CAUSE, PC, -1,				\
 									\
   FPR_BASE,      FPR_BASE + 1,  FPR_BASE + 2,  FPR_BASE + 3,		\
   FPR_BASE + 4,  FPR_BASE + 5,  FPR_BASE + 6,  FPR_BASE + 7,		\
diff --git a/gdb/regformats/mips-dsp-linux.dat b/gdb/regformats/mips-dsp-linux.dat
index ce37bf3..4793256 100644
--- a/gdb/regformats/mips-dsp-linux.dat
+++ b/gdb/regformats/mips-dsp-linux.dat
@@ -41,6 +41,7 @@  expedite:r29,pc
 32:badvaddr
 32:cause
 32:pc
+32:config5
 32:f0
 32:f1
 32:f2
diff --git a/gdb/regformats/mips-linux.dat b/gdb/regformats/mips-linux.dat
index d95e2c9..69457a6 100644
--- a/gdb/regformats/mips-linux.dat
+++ b/gdb/regformats/mips-linux.dat
@@ -41,6 +41,7 @@  expedite:r29,pc
 32:badvaddr
 32:cause
 32:pc
+32:config5
 32:f0
 32:f1
 32:f2
diff --git a/gdb/regformats/mips64-dsp-linux.dat b/gdb/regformats/mips64-dsp-linux.dat
index e73df93..4f30a31 100644
--- a/gdb/regformats/mips64-dsp-linux.dat
+++ b/gdb/regformats/mips64-dsp-linux.dat
@@ -41,6 +41,7 @@  expedite:r29,pc
 64:badvaddr
 64:cause
 64:pc
+64:config5
 64:f0
 64:f1
 64:f2
diff --git a/gdb/regformats/mips64-linux.dat b/gdb/regformats/mips64-linux.dat
index 6770c8f..43144ca 100644
--- a/gdb/regformats/mips64-linux.dat
+++ b/gdb/regformats/mips64-linux.dat
@@ -41,6 +41,7 @@  expedite:r29,pc
 64:badvaddr
 64:cause
 64:pc
+64:config5
 64:f0
 64:f1
 64:f2