Blame SOURCES/gdb-rhbz1187581-power8-regs-not-in-8.2-12of15.patch

7cb06c
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
7cb06c
From: Keith Seitz <keiths@redhat.com>
7cb06c
Date: Fri, 11 Jan 2019 17:02:17 -0500
7cb06c
Subject: gdb-rhbz1187581-power8-regs-not-in-8.2-12of15.patch
7cb06c
7cb06c
;; [PowerPC] Add support for EBB and PMU registers
7cb06c
;; Edjunior Barbosa Machado and Pedro Franco de Carvalho, RH BZ 1187581m
7cb06c
7cb06c
[PowerPC] Add support for EBB and PMU registers
7cb06c
7cb06c
This patch adds support for registers of the Event Based Branching and
7cb06c
Performance Monitoring Units for the powerpc linux native and core
7cb06c
file targets, and for the powerpc linux server stub.
7cb06c
7cb06c
All three EBB registers are accessible.  Only a subset of the PMU
7cb06c
registers can be accessed through ptrace.  Because of this, the PMU
7cb06c
registers are enumerated individually in gdbarch_tdep, as opposed to
7cb06c
having a single "have_pmu" flag.  This is intended to make it easier
7cb06c
to add additional PMU registers in the future, since checking a
7cb06c
"have_pmu" flag elsewhere in the code would no longer be correct.  The
7cb06c
tdesc feature is named org.gnu.gdb.power.linux.pmu because of this.
7cb06c
7cb06c
It's unclear if it makes sense to save and restore these registers
7cb06c
across function calls, since some of them can be modified
7cb06c
asynchronously.  They are also not tracked in record-replay mode.
7cb06c
7cb06c
The kernel can return ENODATA when ptrace is used to get the EBB
7cb06c
registers, unless a linux performance event that uses EBB is open in
7cb06c
the inferior.  For this reason, the "fill" functions in the server
7cb06c
stub for the ebb register sets is not implemented.
7cb06c
7cb06c
Since gdbserver writes all registers in one go before resuming the
7cb06c
inferior, this error would not be detected at the time the user tries
7cb06c
to write to one of the registers on the client side, and gdbserver
7cb06c
would print out warnings every time it resumes the inferior when no
7cb06c
ebb performance event is opened, so there is currently no
7cb06c
straightforward way to handle this case.  This means the ebb registers
7cb06c
in the client-side regcache can become dirty when the user tries to
7cb06c
write to them, until the inferior is resumed and stopped again.
7cb06c
7cb06c
A related issue is that 'G' packets used to write to unrelated
7cb06c
registers will include bad data for the EBB registers if they are
7cb06c
unavailable, since no register status information is included in the
7cb06c
'G' packet.  This data won't be written to the inferior by the
7cb06c
gdbserver stub because the "fill" functions are not implemented, and
7cb06c
currently the gdbserver stub doesn't change the status of the
7cb06c
registers in its own regcache in response to 'G' packets.
7cb06c
7cb06c
Another limitation for the ebb registers is that traceframes don't
7cb06c
record if registers are available or not, so if these registers are
7cb06c
collected when a tracepoint is hit and the inferior has no ebb event
7cb06c
opened, the user will see zero values for all of them, instead of the
7cb06c
usual <unavailable>.
7cb06c
7cb06c
Because these registers are often unavailable, trying to store them
7cb06c
with target_store_registers with -1 for the regno argument (all
7cb06c
registers) would almost always fail, so they are ignored in this case.
7cb06c
7cb06c
gdb/ChangeLog:
7cb06c
2018-10-26  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
7cb06c
        Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
7cb06c
7cb06c
    * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_EBBREGSET)
7cb06c
    (PPC_LINUX_SIZEOF_PMUREGSET): Declare.
7cb06c
    * nat/ppc-linux.h (PPC_FEATURE2_EBB, NT_PPC_EBB, NT_PPC_PMU):
7cb06c
    Define if not already defined.
7cb06c
    * features/rs6000/power-ebb.xml: New file.
7cb06c
    * features/rs6000/power-linux-pmu.xml: New file.
7cb06c
    * features/rs6000/powerpc-isa207-vsx32l.xml: Include ebb and pmu
7cb06c
    features.
7cb06c
    * features/rs6000/powerpc-isa207-vsx64l.xml: Likewise.
7cb06c
    * features/rs6000/powerpc-isa207-vsx32l.c: Re-generate.
7cb06c
    * features/rs6000/powerpc-isa207-vsx64l.c: Re-generate.
7cb06c
    * regformats/rs6000/powerpc-isa207-vsx32l.dat: Re-generate.
7cb06c
    * regformats/rs6000/powerpc-isa207-vsx64l.dat: Re-generate.
7cb06c
    * ppc-linux-nat.c (fetch_register, fetch_ppc_registers): Call
7cb06c
    fetch_regset with ebb and pmu regsets.
7cb06c
    (store_register, store_ppc_registers): Call store_regset with ebb
7cb06c
    and pmu regsets.
7cb06c
    (ppc_linux_nat_target::read_description): Set isa207 field in the
7cb06c
    features struct if ebb and pmu are avaiable.
7cb06c
    * ppc-linux-tdep.c (ppc32_regmap_ebb, ppc32_regmap_pmu)
7cb06c
    (ppc32_linux_ebbregset, ppc32_linux_pmuregset): New globals.
7cb06c
    (ppc_linux_iterate_over_regset_sections): Call back with the ebb
7cb06c
    and pmu regsets.
7cb06c
    (ppc_linux_core_read_description): Check if the pmu section is
7cb06c
    present and set isa207 in the features struct.
7cb06c
    * ppc-linux-tdep.h (ppc32_linux_ebbregset)
7cb06c
    (ppc32_linux_pmuregset): Declare.
7cb06c
    * ppc-tdep.h (struct gdbarch_tdep) <ppc_mmcr0_regnum>: New field.
7cb06c
    <ppc_mmcr2_regnum, ppc_siar_regnum, ppc_sdar_regnum>: New fields.
7cb06c
    <ppc_sier_regnum>: New field.
7cb06c
    (enum): <PPC_BESCR_REGNUM, PPC_EBBHR_REGNUM, PPC_EBBRR_REGNUM>:
7cb06c
    New enum values.
7cb06c
    <PPC_MMCR0_REGNUM, PPC_MMCR2_REGNUM, PPC_SIAR_REGNUM>: New enum
7cb06c
    values.
7cb06c
    <PPC_SDAR_REGNUM, PPC_SIER_REGNUM>: New enum values.
7cb06c
    (PPC_IS_EBB_REGNUM, PPC_IS_PMU_REGNUM): Define.
7cb06c
    * rs6000-tdep.c (rs6000_gdbarch_init): Look for and validate the
7cb06c
    ebb and pmu features.
7cb06c
7cb06c
gdb/gdbserver/ChangeLog:
7cb06c
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
7cb06c
7cb06c
    * configure.srv (powerpc*-*-linux*): Add rs6000/power-ebb.xml and
7cb06c
    rs6000/power-linux-pmu.xml to srv_xmlfiles.
7cb06c
    * linux-ppc-low.c (ppc_store_ebbregset, ppc_fill_pmuregset)
7cb06c
    (ppc_store_pmuregset): New functions.
7cb06c
    (ppc_regsets): Add entries for ebb and pmu regsets.
7cb06c
    (ppc_arch_setup): Set isa207 in features struct if the ebb and
7cb06c
    pmu regsets are available.  Set sizes for these regsets.
7cb06c
7cb06c
gdb/doc/ChangeLog:
7cb06c
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
7cb06c
7cb06c
    * gdb.texinfo (PowerPC Features): Describe new features
7cb06c
    "org.gnu.gdb.power.ebb" and "org.gnu.gdb.power.linux.pmu".
7cb06c
7cb06c
diff --git a/gdb/arch/ppc-linux-common.h b/gdb/arch/ppc-linux-common.h
7cb06c
--- a/gdb/arch/ppc-linux-common.h
7cb06c
+++ b/gdb/arch/ppc-linux-common.h
7cb06c
@@ -33,6 +33,8 @@ struct target_desc;
7cb06c
 #define PPC_LINUX_SIZEOF_PPRREGSET 8
7cb06c
 #define PPC_LINUX_SIZEOF_DSCRREGSET 8
7cb06c
 #define PPC_LINUX_SIZEOF_TARREGSET 8
7cb06c
+#define PPC_LINUX_SIZEOF_EBBREGSET (3*8)
7cb06c
+#define PPC_LINUX_SIZEOF_PMUREGSET (5*8)
7cb06c
 
7cb06c
 /* Check if the hwcap auxv entry indicates that isa205 is supported.  */
7cb06c
 bool ppc_linux_has_isa205 (CORE_ADDR hwcap);
7cb06c
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
7cb06c
--- a/gdb/doc/gdb.texinfo
7cb06c
+++ b/gdb/doc/gdb.texinfo
7cb06c
@@ -42564,6 +42564,15 @@ contain the 64-bit register @samp{dscr}.
7cb06c
 The @samp{org.gnu.gdb.power.tar} feature is optional.  It should
7cb06c
 contain the 64-bit register @samp{tar}.
7cb06c
 
7cb06c
+The @samp{org.gnu.gdb.power.ebb} feature is optional.  It should
7cb06c
+contain registers @samp{bescr}, @samp{ebbhr} and @samp{ebbrr}, all
7cb06c
+64-bit wide.
7cb06c
+
7cb06c
+The @samp{org.gnu.gdb.power.linux.pmu} feature is optional.  It should
7cb06c
+contain registers @samp{mmcr0}, @samp{mmcr2}, @samp{siar}, @samp{sdar}
7cb06c
+and @samp{sier}, all 64-bit wide.  This is the subset of the isa 2.07
7cb06c
+server PMU registers provided by @sc{gnu}/Linux.
7cb06c
+
7cb06c
 @node S/390 and System z Features
7cb06c
 @subsection S/390 and System z Features
7cb06c
 @cindex target descriptions, S/390 features
7cb06c
diff --git a/gdb/features/rs6000/power-ebb.xml b/gdb/features/rs6000/power-ebb.xml
7cb06c
new file mode 100644
7cb06c
--- /dev/null
7cb06c
+++ b/gdb/features/rs6000/power-ebb.xml
7cb06c
@@ -0,0 +1,14 @@
7cb06c
+
7cb06c
+
7cb06c
+
7cb06c
+     Copying and distribution of this file, with or without modification,
7cb06c
+     are permitted in any medium without royalty provided the copyright
7cb06c
+     notice and this notice are preserved.  -->
7cb06c
+
7cb06c
+
7cb06c
+
7cb06c
+<feature name="org.gnu.gdb.power.ebb">
7cb06c
+  <reg name="bescr" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="ebbhr" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="ebbrr" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+</feature>
7cb06c
diff --git a/gdb/features/rs6000/power-linux-pmu.xml b/gdb/features/rs6000/power-linux-pmu.xml
7cb06c
new file mode 100644
7cb06c
--- /dev/null
7cb06c
+++ b/gdb/features/rs6000/power-linux-pmu.xml
7cb06c
@@ -0,0 +1,17 @@
7cb06c
+
7cb06c
+
7cb06c
+
7cb06c
+     Copying and distribution of this file, with or without modification,
7cb06c
+     are permitted in any medium without royalty provided the copyright
7cb06c
+     notice and this notice are preserved.  -->
7cb06c
+
7cb06c
+
7cb06c
+     provided by Linux.  -->
7cb06c
+
7cb06c
+<feature name="org.gnu.gdb.power.linux.pmu">
7cb06c
+  <reg name="mmcr0" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="mmcr2" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="siar" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="sdar" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+  <reg name="sier" bitsize="64" type="uint64" save-restore="no"/>
7cb06c
+</feature>
7cb06c
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx32l.c b/gdb/features/rs6000/powerpc-isa207-vsx32l.c
7cb06c
--- a/gdb/features/rs6000/powerpc-isa207-vsx32l.c
7cb06c
+++ b/gdb/features/rs6000/powerpc-isa207-vsx32l.c
7cb06c
@@ -199,5 +199,17 @@ initialize_tdesc_powerpc_isa207_vsx32l (void)
7cb06c
   feature = tdesc_create_feature (result, "org.gnu.gdb.power.tar");
7cb06c
   tdesc_create_reg (feature, "tar", 141, 1, NULL, 64, "uint64");
7cb06c
 
7cb06c
+  feature = tdesc_create_feature (result, "org.gnu.gdb.power.ebb");
7cb06c
+  tdesc_create_reg (feature, "bescr", 142, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "ebbhr", 143, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "ebbrr", 144, 0, NULL, 64, "uint64");
7cb06c
+
7cb06c
+  feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux.pmu");
7cb06c
+  tdesc_create_reg (feature, "mmcr0", 145, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "mmcr2", 146, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "siar", 147, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "sdar", 148, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "sier", 149, 0, NULL, 64, "uint64");
7cb06c
+
7cb06c
   tdesc_powerpc_isa207_vsx32l = result;
7cb06c
 }
7cb06c
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx32l.xml b/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
7cb06c
--- a/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
7cb06c
+++ b/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
7cb06c
@@ -16,4 +16,6 @@
7cb06c
   <xi:include href="power-ppr.xml"/>
7cb06c
   <xi:include href="power-dscr.xml"/>
7cb06c
   <xi:include href="power-tar.xml"/>
7cb06c
+  <xi:include href="power-ebb.xml"/>
7cb06c
+  <xi:include href="power-linux-pmu.xml"/>
7cb06c
 </target>
7cb06c
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx64l.c b/gdb/features/rs6000/powerpc-isa207-vsx64l.c
7cb06c
--- a/gdb/features/rs6000/powerpc-isa207-vsx64l.c
7cb06c
+++ b/gdb/features/rs6000/powerpc-isa207-vsx64l.c
7cb06c
@@ -199,5 +199,17 @@ initialize_tdesc_powerpc_isa207_vsx64l (void)
7cb06c
   feature = tdesc_create_feature (result, "org.gnu.gdb.power.tar");
7cb06c
   tdesc_create_reg (feature, "tar", 141, 1, NULL, 64, "uint64");
7cb06c
 
7cb06c
+  feature = tdesc_create_feature (result, "org.gnu.gdb.power.ebb");
7cb06c
+  tdesc_create_reg (feature, "bescr", 142, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "ebbhr", 143, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "ebbrr", 144, 0, NULL, 64, "uint64");
7cb06c
+
7cb06c
+  feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux.pmu");
7cb06c
+  tdesc_create_reg (feature, "mmcr0", 145, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "mmcr2", 146, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "siar", 147, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "sdar", 148, 0, NULL, 64, "uint64");
7cb06c
+  tdesc_create_reg (feature, "sier", 149, 0, NULL, 64, "uint64");
7cb06c
+
7cb06c
   tdesc_powerpc_isa207_vsx64l = result;
7cb06c
 }
7cb06c
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx64l.xml b/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
7cb06c
--- a/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
7cb06c
+++ b/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
7cb06c
@@ -16,4 +16,6 @@
7cb06c
   <xi:include href="power-ppr.xml"/>
7cb06c
   <xi:include href="power-dscr.xml"/>
7cb06c
   <xi:include href="power-tar.xml"/>
7cb06c
+  <xi:include href="power-ebb.xml"/>
7cb06c
+  <xi:include href="power-linux-pmu.xml"/>
7cb06c
 </target>
7cb06c
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
7cb06c
--- a/gdb/gdbserver/configure.srv
7cb06c
+++ b/gdb/gdbserver/configure.srv
7cb06c
@@ -249,6 +249,8 @@ case "${target}" in
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/power-dscr.xml"
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/power-ppr.xml"
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/power-tar.xml"
7cb06c
+			srv_xmlfiles="${srv_xmlfiles} rs6000/power-ebb.xml"
7cb06c
+			srv_xmlfiles="${srv_xmlfiles} rs6000/power-linux-pmu.xml"
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500l.xml"
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/power-spe.xml"
7cb06c
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-64l.xml"
7cb06c
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
7cb06c
--- a/gdb/gdbserver/linux-ppc-low.c
7cb06c
+++ b/gdb/gdbserver/linux-ppc-low.c
7cb06c
@@ -545,6 +545,61 @@ ppc_store_tarregset (struct regcache *regcache, const void *buf)
7cb06c
   supply_register_by_name (regcache, "tar", tar);
7cb06c
 }
7cb06c
 
7cb06c
+/* Event-Based Branching regset store function.  Unless the inferior
7cb06c
+   has a perf event open, ptrace can return in error when reading and
7cb06c
+   writing to the regset, with ENODATA.  For reading, the registers
7cb06c
+   will correctly show as unavailable.  For writing, gdbserver
7cb06c
+   currently only caches any register writes from P and G packets and
7cb06c
+   the stub always tries to write all the regsets when resuming the
7cb06c
+   inferior, which would result in frequent warnings.  For this
7cb06c
+   reason, we don't define a fill function.  This also means that the
7cb06c
+   client-side regcache will be dirty if the user tries to write to
7cb06c
+   the EBB registers.  G packets that the client sends to write to
7cb06c
+   unrelated registers will also include data for EBB registers, even
7cb06c
+   if they are unavailable.  */
7cb06c
+
7cb06c
+static void
7cb06c
+ppc_store_ebbregset (struct regcache *regcache, const void *buf)
7cb06c
+{
7cb06c
+  const char *regset = (const char *) buf;
7cb06c
+
7cb06c
+  /* The order in the kernel regset is: EBBRR, EBBHR, BESCR.  In the
7cb06c
+     .dat file is BESCR, EBBHR, EBBRR.  */
7cb06c
+  supply_register_by_name (regcache, "ebbrr", &regset[0]);
7cb06c
+  supply_register_by_name (regcache, "ebbhr", &regset[8]);
7cb06c
+  supply_register_by_name (regcache, "bescr", &regset[16]);
7cb06c
+}
7cb06c
+
7cb06c
+/* Performance Monitoring Unit regset fill function.  */
7cb06c
+
7cb06c
+static void
7cb06c
+ppc_fill_pmuregset (struct regcache *regcache, void *buf)
7cb06c
+{
7cb06c
+  char *regset = (char *) buf;
7cb06c
+
7cb06c
+  /* The order in the kernel regset is SIAR, SDAR, SIER, MMCR2, MMCR0.
7cb06c
+     In the .dat file is MMCR0, MMCR2, SIAR, SDAR, SIER.  */
7cb06c
+  collect_register_by_name (regcache, "siar", &regset[0]);
7cb06c
+  collect_register_by_name (regcache, "sdar", &regset[8]);
7cb06c
+  collect_register_by_name (regcache, "sier", &regset[16]);
7cb06c
+  collect_register_by_name (regcache, "mmcr2", &regset[24]);
7cb06c
+  collect_register_by_name (regcache, "mmcr0", &regset[32]);
7cb06c
+}
7cb06c
+
7cb06c
+/* Performance Monitoring Unit regset store function.  */
7cb06c
+
7cb06c
+static void
7cb06c
+ppc_store_pmuregset (struct regcache *regcache, const void *buf)
7cb06c
+{
7cb06c
+  const char *regset = (const char *) buf;
7cb06c
+
7cb06c
+  supply_register_by_name (regcache, "siar", &regset[0]);
7cb06c
+  supply_register_by_name (regcache, "sdar", &regset[8]);
7cb06c
+  supply_register_by_name (regcache, "sier", &regset[16]);
7cb06c
+  supply_register_by_name (regcache, "mmcr2", &regset[24]);
7cb06c
+  supply_register_by_name (regcache, "mmcr0", &regset[32]);
7cb06c
+}
7cb06c
+
7cb06c
 static void
7cb06c
 ppc_fill_vsxregset (struct regcache *regcache, void *buf)
7cb06c
 {
7cb06c
@@ -654,6 +709,10 @@ static struct regset_info ppc_regsets[] = {
7cb06c
      fetch them every time, but still fall back to PTRACE_PEEKUSER for the
7cb06c
      general registers.  Some kernels support these, but not the newer
7cb06c
      PPC_PTRACE_GETREGS.  */
7cb06c
+  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PPC_EBB, 0, EXTENDED_REGS,
7cb06c
+    NULL, ppc_store_ebbregset },
7cb06c
+  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PPC_PMU, 0, EXTENDED_REGS,
7cb06c
+    ppc_fill_pmuregset, ppc_store_pmuregset },
7cb06c
   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PPC_TAR, 0, EXTENDED_REGS,
7cb06c
     ppc_fill_tarregset, ppc_store_tarregset },
7cb06c
   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PPC_PPR, 0, EXTENDED_REGS,
7cb06c
@@ -734,8 +793,13 @@ ppc_arch_setup (void)
7cb06c
       features.ppr_dscr = true;
7cb06c
       if ((ppc_hwcap2 & PPC_FEATURE2_ARCH_2_07)
7cb06c
 	  && (ppc_hwcap2 & PPC_FEATURE2_TAR)
7cb06c
+	  && (ppc_hwcap2 & PPC_FEATURE2_EBB)
7cb06c
 	  && ppc_check_regset (tid, NT_PPC_TAR,
7cb06c
-			       PPC_LINUX_SIZEOF_TARREGSET))
7cb06c
+			       PPC_LINUX_SIZEOF_TARREGSET)
7cb06c
+	  && ppc_check_regset (tid, NT_PPC_EBB,
7cb06c
+			       PPC_LINUX_SIZEOF_EBBREGSET)
7cb06c
+	  && ppc_check_regset (tid, NT_PPC_PMU,
7cb06c
+			       PPC_LINUX_SIZEOF_PMUREGSET))
7cb06c
 	features.isa207 = true;
7cb06c
     }
7cb06c
 
7cb06c
@@ -798,6 +862,14 @@ ppc_arch_setup (void)
7cb06c
 	    regset->size = (features.isa207 ?
7cb06c
 			    PPC_LINUX_SIZEOF_TARREGSET : 0);
7cb06c
 	    break;
7cb06c
+	  case NT_PPC_EBB:
7cb06c
+	    regset->size = (features.isa207 ?
7cb06c
+			    PPC_LINUX_SIZEOF_EBBREGSET : 0);
7cb06c
+	    break;
7cb06c
+	  case NT_PPC_PMU:
7cb06c
+	    regset->size = (features.isa207 ?
7cb06c
+			    PPC_LINUX_SIZEOF_PMUREGSET : 0);
7cb06c
+	    break;
7cb06c
 	  default:
7cb06c
 	    break;
7cb06c
 	  }
7cb06c
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
7cb06c
--- a/gdb/nat/ppc-linux.h
7cb06c
+++ b/gdb/nat/ppc-linux.h
7cb06c
@@ -60,6 +60,9 @@
7cb06c
 #ifndef PPC_FEATURE2_TAR
7cb06c
 #define PPC_FEATURE2_TAR 0x04000000
7cb06c
 #endif
7cb06c
+#ifndef PPC_FEATURE2_EBB
7cb06c
+#define PPC_FEATURE2_EBB 0x10000000
7cb06c
+#endif
7cb06c
 
7cb06c
 /* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
7cb06c
    configure time check.  Some older glibc's (for instance 2.2.1)
7cb06c
@@ -106,6 +109,16 @@
7cb06c
 #define NT_PPC_DSCR 0x105
7cb06c
 #endif
7cb06c
 
7cb06c
+/* Event Based Branch Registers.  */
7cb06c
+#ifndef NT_PPC_EBB
7cb06c
+#define NT_PPC_EBB 0x106
7cb06c
+#endif
7cb06c
+
7cb06c
+/* Performance Monitor Registers.  */
7cb06c
+#ifndef NT_PPC_PMU
7cb06c
+#define NT_PPC_PMU 0x107
7cb06c
+#endif
7cb06c
+
7cb06c
 /* Return the wordsize of the target, either 4 or 8 bytes.  */
7cb06c
 int ppc_linux_target_wordsize (int tid);
7cb06c
 
7cb06c
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
7cb06c
--- a/gdb/ppc-linux-nat.c
7cb06c
+++ b/gdb/ppc-linux-nat.c
7cb06c
@@ -667,6 +667,24 @@ fetch_register (struct regcache *regcache, int tid, int regno)
7cb06c
 		    &ppc32_linux_tarregset);
7cb06c
       return;
7cb06c
     }
7cb06c
+  else if (PPC_IS_EBB_REGNUM (regno))
7cb06c
+    {
7cb06c
+      gdb_assert (tdep->have_ebb);
7cb06c
+
7cb06c
+      fetch_regset (regcache, tid, NT_PPC_EBB,
7cb06c
+		    PPC_LINUX_SIZEOF_EBBREGSET,
7cb06c
+		    &ppc32_linux_ebbregset);
7cb06c
+      return;
7cb06c
+    }
7cb06c
+  else if (PPC_IS_PMU_REGNUM (regno))
7cb06c
+    {
7cb06c
+      gdb_assert (tdep->ppc_mmcr0_regnum != -1);
7cb06c
+
7cb06c
+      fetch_regset (regcache, tid, NT_PPC_PMU,
7cb06c
+		    PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+		    &ppc32_linux_pmuregset);
7cb06c
+      return;
7cb06c
+    }
7cb06c
 
7cb06c
   if (regaddr == -1)
7cb06c
     {
7cb06c
@@ -875,6 +893,14 @@ fetch_ppc_registers (struct regcache *regcache, int tid)
7cb06c
     fetch_regset (regcache, tid, NT_PPC_TAR,
7cb06c
 		  PPC_LINUX_SIZEOF_TARREGSET,
7cb06c
 		  &ppc32_linux_tarregset);
7cb06c
+  if (tdep->have_ebb)
7cb06c
+    fetch_regset (regcache, tid, NT_PPC_EBB,
7cb06c
+		  PPC_LINUX_SIZEOF_EBBREGSET,
7cb06c
+		  &ppc32_linux_ebbregset);
7cb06c
+  if (tdep->ppc_mmcr0_regnum != -1)
7cb06c
+    fetch_regset (regcache, tid, NT_PPC_PMU,
7cb06c
+		  PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+		  &ppc32_linux_pmuregset);
7cb06c
 }
7cb06c
 
7cb06c
 /* Fetch registers from the child process.  Fetch all registers if
7cb06c
@@ -1082,6 +1108,24 @@ store_register (const struct regcache *regcache, int tid, int regno)
7cb06c
 		    &ppc32_linux_tarregset);
7cb06c
       return;
7cb06c
     }
7cb06c
+  else if (PPC_IS_EBB_REGNUM (regno))
7cb06c
+    {
7cb06c
+      gdb_assert (tdep->have_ebb);
7cb06c
+
7cb06c
+      store_regset (regcache, tid, regno, NT_PPC_EBB,
7cb06c
+		    PPC_LINUX_SIZEOF_EBBREGSET,
7cb06c
+		    &ppc32_linux_ebbregset);
7cb06c
+      return;
7cb06c
+    }
7cb06c
+  else if (PPC_IS_PMU_REGNUM (regno))
7cb06c
+    {
7cb06c
+      gdb_assert (tdep->ppc_mmcr0_regnum != -1);
7cb06c
+
7cb06c
+      store_regset (regcache, tid, regno, NT_PPC_PMU,
7cb06c
+		    PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+		    &ppc32_linux_pmuregset);
7cb06c
+      return;
7cb06c
+    }
7cb06c
 
7cb06c
   if (regaddr == -1)
7cb06c
     return;
7cb06c
@@ -1308,6 +1352,15 @@ store_ppc_registers (const struct regcache *regcache, int tid)
7cb06c
     store_regset (regcache, tid, -1, NT_PPC_TAR,
7cb06c
 		  PPC_LINUX_SIZEOF_TARREGSET,
7cb06c
 		  &ppc32_linux_tarregset);
7cb06c
+
7cb06c
+  if (tdep->ppc_mmcr0_regnum != -1)
7cb06c
+    store_regset (regcache, tid, -1, NT_PPC_PMU,
7cb06c
+		  PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+		  &ppc32_linux_pmuregset);
7cb06c
+
7cb06c
+  /* Because the EBB registers can be unavailable, attempts to store
7cb06c
+     them here would cause this function to fail most of the time, so
7cb06c
+     we ignore them.  */
7cb06c
 }
7cb06c
 
7cb06c
 /* Fetch the AT_HWCAP entry from the aux vector.  */
7cb06c
@@ -2439,7 +2492,10 @@ ppc_linux_nat_target::read_description ()
7cb06c
       features.ppr_dscr = true;
7cb06c
       if ((hwcap2 & PPC_FEATURE2_ARCH_2_07)
7cb06c
 	  && (hwcap2 & PPC_FEATURE2_TAR)
7cb06c
-	  && check_regset (tid, NT_PPC_TAR, PPC_LINUX_SIZEOF_TARREGSET))
7cb06c
+	  && (hwcap2 & PPC_FEATURE2_EBB)
7cb06c
+	  && check_regset (tid, NT_PPC_TAR, PPC_LINUX_SIZEOF_TARREGSET)
7cb06c
+	  && check_regset (tid, NT_PPC_EBB, PPC_LINUX_SIZEOF_EBBREGSET)
7cb06c
+	  && check_regset (tid, NT_PPC_PMU, PPC_LINUX_SIZEOF_PMUREGSET))
7cb06c
 	features.isa207 = true;
7cb06c
     }
7cb06c
 
7cb06c
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
7cb06c
--- a/gdb/ppc-linux-tdep.c
7cb06c
+++ b/gdb/ppc-linux-tdep.c
7cb06c
@@ -599,6 +599,44 @@ const struct regset ppc32_linux_tarregset = {
7cb06c
   regcache_collect_regset
7cb06c
 };
7cb06c
 
7cb06c
+/* Event-Based Branching regmap.  */
7cb06c
+
7cb06c
+static const struct regcache_map_entry ppc32_regmap_ebb[] =
7cb06c
+  {
7cb06c
+      { 1, PPC_EBBRR_REGNUM, 8 },
7cb06c
+      { 1, PPC_EBBHR_REGNUM, 8 },
7cb06c
+      { 1, PPC_BESCR_REGNUM, 8 },
7cb06c
+      { 0 }
7cb06c
+  };
7cb06c
+
7cb06c
+/* Event-Based Branching regset.  */
7cb06c
+
7cb06c
+const struct regset ppc32_linux_ebbregset = {
7cb06c
+  ppc32_regmap_ebb,
7cb06c
+  regcache_supply_regset,
7cb06c
+  regcache_collect_regset
7cb06c
+};
7cb06c
+
7cb06c
+/* Performance Monitoring Unit regmap.  */
7cb06c
+
7cb06c
+static const struct regcache_map_entry ppc32_regmap_pmu[] =
7cb06c
+  {
7cb06c
+      { 1, PPC_SIAR_REGNUM, 8 },
7cb06c
+      { 1, PPC_SDAR_REGNUM, 8 },
7cb06c
+      { 1, PPC_SIER_REGNUM, 8 },
7cb06c
+      { 1, PPC_MMCR2_REGNUM, 8 },
7cb06c
+      { 1, PPC_MMCR0_REGNUM, 8 },
7cb06c
+      { 0 }
7cb06c
+  };
7cb06c
+
7cb06c
+/* Performance Monitoring Unit regset.  */
7cb06c
+
7cb06c
+const struct regset ppc32_linux_pmuregset = {
7cb06c
+  ppc32_regmap_pmu,
7cb06c
+  regcache_supply_regset,
7cb06c
+  regcache_collect_regset
7cb06c
+};
7cb06c
+
7cb06c
 const struct regset *
7cb06c
 ppc_linux_gregset (int wordsize)
7cb06c
 {
7cb06c
@@ -674,6 +712,22 @@ ppc_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
7cb06c
     cb (".reg-ppc-tar", PPC_LINUX_SIZEOF_TARREGSET,
7cb06c
 	PPC_LINUX_SIZEOF_TARREGSET,
7cb06c
 	&ppc32_linux_tarregset, "Target Address Register", cb_data);
7cb06c
+
7cb06c
+  /* EBB registers are unavailable when ptrace returns ENODATA.  Check
7cb06c
+     availability when generating a core file (regcache != NULL).  */
7cb06c
+  if (tdep->have_ebb)
7cb06c
+    if (regcache == NULL
7cb06c
+	|| REG_VALID == regcache->get_register_status (PPC_BESCR_REGNUM))
7cb06c
+      cb (".reg-ppc-ebb", PPC_LINUX_SIZEOF_EBBREGSET,
7cb06c
+	  PPC_LINUX_SIZEOF_EBBREGSET,
7cb06c
+	  &ppc32_linux_ebbregset, "Event-based Branching Registers",
7cb06c
+	  cb_data);
7cb06c
+
7cb06c
+  if (tdep->ppc_mmcr0_regnum != -1)
7cb06c
+    cb (".reg-ppc-pmu", PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+	PPC_LINUX_SIZEOF_PMUREGSET,
7cb06c
+	&ppc32_linux_pmuregset, "Performance Monitor Registers",
7cb06c
+	cb_data);
7cb06c
 }
7cb06c
 
7cb06c
 static void
7cb06c
@@ -1089,6 +1143,7 @@ ppc_linux_core_read_description (struct gdbarch *gdbarch,
7cb06c
   asection *ppr = bfd_get_section_by_name (abfd, ".reg-ppc-ppr");
7cb06c
   asection *dscr = bfd_get_section_by_name (abfd, ".reg-ppc-dscr");
7cb06c
   asection *tar = bfd_get_section_by_name (abfd, ".reg-ppc-tar");
7cb06c
+  asection *pmu = bfd_get_section_by_name (abfd, ".reg-ppc-pmu");
7cb06c
 
7cb06c
   if (! section)
7cb06c
     return NULL;
7cb06c
@@ -1124,7 +1179,12 @@ ppc_linux_core_read_description (struct gdbarch *gdbarch,
7cb06c
   if (ppr && dscr)
7cb06c
     {
7cb06c
       features.ppr_dscr = true;
7cb06c
-      if (tar)
7cb06c
+
7cb06c
+      /* We don't require the EBB note section to be present in the
7cb06c
+	 core file to select isa207 because these registers could have
7cb06c
+	 been unavailable when the core file was created.  They will
7cb06c
+	 be in the tdep but will show as unavailable.  */
7cb06c
+      if (tar && pmu)
7cb06c
 	features.isa207 = true;
7cb06c
     }
7cb06c
 
7cb06c
diff --git a/gdb/ppc-linux-tdep.h b/gdb/ppc-linux-tdep.h
7cb06c
--- a/gdb/ppc-linux-tdep.h
7cb06c
+++ b/gdb/ppc-linux-tdep.h
7cb06c
@@ -48,5 +48,7 @@ int ppc_linux_trap_reg_p (struct gdbarch *gdbarch);
7cb06c
 extern const struct regset ppc32_linux_pprregset;
7cb06c
 extern const struct regset ppc32_linux_dscrregset;
7cb06c
 extern const struct regset ppc32_linux_tarregset;
7cb06c
+extern const struct regset ppc32_linux_ebbregset;
7cb06c
+extern const struct regset ppc32_linux_pmuregset;
7cb06c
 
7cb06c
 #endif /* PPC_LINUX_TDEP_H */
7cb06c
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
7cb06c
--- a/gdb/ppc-tdep.h
7cb06c
+++ b/gdb/ppc-tdep.h
7cb06c
@@ -265,6 +265,15 @@ struct gdbarch_tdep
7cb06c
     /* Decimal 128 registers.  */
7cb06c
     int ppc_dl0_regnum;		/* First Decimal128 argument register pair.  */
7cb06c
 
7cb06c
+    int have_ebb;
7cb06c
+
7cb06c
+    /* PMU registers.  */
7cb06c
+    int ppc_mmcr0_regnum;
7cb06c
+    int ppc_mmcr2_regnum;
7cb06c
+    int ppc_siar_regnum;
7cb06c
+    int ppc_sdar_regnum;
7cb06c
+    int ppc_sier_regnum;
7cb06c
+
7cb06c
     /* Offset to ABI specific location where link register is saved.  */
7cb06c
     int lr_frame_offset;	
7cb06c
 
7cb06c
@@ -321,12 +330,31 @@ enum {
7cb06c
   PPC_PPR_REGNUM = 172,
7cb06c
   PPC_DSCR_REGNUM = 173,
7cb06c
   PPC_TAR_REGNUM = 174,
7cb06c
+
7cb06c
+  /* EBB registers.  */
7cb06c
+  PPC_BESCR_REGNUM = 175,
7cb06c
+  PPC_EBBHR_REGNUM = 176,
7cb06c
+  PPC_EBBRR_REGNUM = 177,
7cb06c
+
7cb06c
+  /* PMU registers.  */
7cb06c
+  PPC_MMCR0_REGNUM = 178,
7cb06c
+  PPC_MMCR2_REGNUM = 179,
7cb06c
+  PPC_SIAR_REGNUM = 180,
7cb06c
+  PPC_SDAR_REGNUM = 181,
7cb06c
+  PPC_SIER_REGNUM = 182,
7cb06c
+
7cb06c
   PPC_NUM_REGS
7cb06c
 };
7cb06c
 
7cb06c
 /* Big enough to hold the size of the largest register in bytes.  */
7cb06c
 #define PPC_MAX_REGISTER_SIZE	64
7cb06c
 
7cb06c
+#define PPC_IS_EBB_REGNUM(i) \
7cb06c
+	((i) >= PPC_BESCR_REGNUM && (i) <= PPC_EBBRR_REGNUM)
7cb06c
+
7cb06c
+#define PPC_IS_PMU_REGNUM(i) \
7cb06c
+	((i) >= PPC_MMCR0_REGNUM && (i) <= PPC_SIER_REGNUM)
7cb06c
+
7cb06c
 /* An instruction to match.  */
7cb06c
 
7cb06c
 struct ppc_insn_pattern
7cb06c
diff --git a/gdb/regformats/rs6000/powerpc-isa207-vsx32l.dat b/gdb/regformats/rs6000/powerpc-isa207-vsx32l.dat
7cb06c
--- a/gdb/regformats/rs6000/powerpc-isa207-vsx32l.dat
7cb06c
+++ b/gdb/regformats/rs6000/powerpc-isa207-vsx32l.dat
7cb06c
@@ -145,3 +145,11 @@ expedite:r1,pc
7cb06c
 64:ppr
7cb06c
 64:dscr
7cb06c
 64:tar
7cb06c
+64:bescr
7cb06c
+64:ebbhr
7cb06c
+64:ebbrr
7cb06c
+64:mmcr0
7cb06c
+64:mmcr2
7cb06c
+64:siar
7cb06c
+64:sdar
7cb06c
+64:sier
7cb06c
diff --git a/gdb/regformats/rs6000/powerpc-isa207-vsx64l.dat b/gdb/regformats/rs6000/powerpc-isa207-vsx64l.dat
7cb06c
--- a/gdb/regformats/rs6000/powerpc-isa207-vsx64l.dat
7cb06c
+++ b/gdb/regformats/rs6000/powerpc-isa207-vsx64l.dat
7cb06c
@@ -145,3 +145,11 @@ expedite:r1,pc
7cb06c
 64:ppr
7cb06c
 64:dscr
7cb06c
 64:tar
7cb06c
+64:bescr
7cb06c
+64:ebbhr
7cb06c
+64:ebbrr
7cb06c
+64:mmcr0
7cb06c
+64:mmcr2
7cb06c
+64:siar
7cb06c
+64:sdar
7cb06c
+64:sier
7cb06c
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
7cb06c
--- a/gdb/rs6000-tdep.c
7cb06c
+++ b/gdb/rs6000-tdep.c
7cb06c
@@ -5871,7 +5871,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
7cb06c
   enum powerpc_elf_abi elf_abi = POWERPC_ELF_AUTO;
7cb06c
   int have_fpu = 0, have_spe = 0, have_mq = 0, have_altivec = 0;
7cb06c
   int have_dfp = 0, have_vsx = 0, have_ppr = 0, have_dscr = 0;
7cb06c
-  int have_tar = 0;
7cb06c
+  int have_tar = 0, have_ebb = 0, have_pmu = 0;
7cb06c
   int tdesc_wordsize = -1;
7cb06c
   const struct target_desc *tdesc = info.target_desc;
7cb06c
   struct tdesc_arch_data *tdesc_data = NULL;
7cb06c
@@ -6211,6 +6211,64 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
7cb06c
 	}
7cb06c
       else
7cb06c
 	have_tar = 0;
7cb06c
+
7cb06c
+      /* Event-based Branching Registers.  */
7cb06c
+      feature = tdesc_find_feature (tdesc,
7cb06c
+				    "org.gnu.gdb.power.ebb");
7cb06c
+      if (feature != NULL)
7cb06c
+	{
7cb06c
+	  static const char *const ebb_regs[] = {
7cb06c
+	    "bescr", "ebbhr", "ebbrr"
7cb06c
+	  };
7cb06c
+
7cb06c
+	  valid_p = 1;
7cb06c
+	  for (i = 0; i < ARRAY_SIZE (ebb_regs); i++)
7cb06c
+	    valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+						PPC_BESCR_REGNUM + i,
7cb06c
+						ebb_regs[i]);
7cb06c
+	  if (!valid_p)
7cb06c
+	    {
7cb06c
+	      tdesc_data_cleanup (tdesc_data);
7cb06c
+	      return NULL;
7cb06c
+	    }
7cb06c
+	  have_ebb = 1;
7cb06c
+	}
7cb06c
+      else
7cb06c
+	have_ebb = 0;
7cb06c
+
7cb06c
+      /* Subset of the ISA 2.07 Performance Monitor Registers provided
7cb06c
+	 by Linux.  */
7cb06c
+      feature = tdesc_find_feature (tdesc,
7cb06c
+				    "org.gnu.gdb.power.linux.pmu");
7cb06c
+      if (feature != NULL)
7cb06c
+	{
7cb06c
+	  valid_p = 1;
7cb06c
+
7cb06c
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+					      PPC_MMCR0_REGNUM,
7cb06c
+					      "mmcr0");
7cb06c
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+					      PPC_MMCR2_REGNUM,
7cb06c
+					      "mmcr2");
7cb06c
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+					      PPC_SIAR_REGNUM,
7cb06c
+					      "siar");
7cb06c
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+					      PPC_SDAR_REGNUM,
7cb06c
+					      "sdar");
7cb06c
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
7cb06c
+					      PPC_SIER_REGNUM,
7cb06c
+					      "sier");
7cb06c
+
7cb06c
+	  if (!valid_p)
7cb06c
+	    {
7cb06c
+	      tdesc_data_cleanup (tdesc_data);
7cb06c
+	      return NULL;
7cb06c
+	    }
7cb06c
+	  have_pmu = 1;
7cb06c
+	}
7cb06c
+      else
7cb06c
+	have_pmu = 0;
7cb06c
     }
7cb06c
 
7cb06c
   /* If we have a 64-bit binary on a 32-bit target, complain.  Also
7cb06c
@@ -6408,6 +6466,20 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
7cb06c
   tdep->ppc_ppr_regnum = have_ppr ? PPC_PPR_REGNUM : -1;
7cb06c
   tdep->ppc_dscr_regnum = have_dscr ? PPC_DSCR_REGNUM : -1;
7cb06c
   tdep->ppc_tar_regnum = have_tar ? PPC_TAR_REGNUM : -1;
7cb06c
+  tdep->have_ebb = have_ebb;
7cb06c
+
7cb06c
+  /* If additional pmu registers are added, care must be taken when
7cb06c
+     setting new fields in the tdep below, to maintain compatibility
7cb06c
+     with features that only provide some of the registers.  Currently
7cb06c
+     gdb access to the pmu registers is only supported in linux, and
7cb06c
+     linux only provides a subset of the pmu registers defined in the
7cb06c
+     architecture.  */
7cb06c
+
7cb06c
+  tdep->ppc_mmcr0_regnum = have_pmu ? PPC_MMCR0_REGNUM : -1;
7cb06c
+  tdep->ppc_mmcr2_regnum = have_pmu ? PPC_MMCR2_REGNUM : -1;
7cb06c
+  tdep->ppc_siar_regnum = have_pmu ? PPC_SIAR_REGNUM : -1;
7cb06c
+  tdep->ppc_sdar_regnum = have_pmu ? PPC_SDAR_REGNUM : -1;
7cb06c
+  tdep->ppc_sier_regnum = have_pmu ? PPC_SIER_REGNUM : -1;
7cb06c
 
7cb06c
   set_gdbarch_pc_regnum (gdbarch, PPC_PC_REGNUM);
7cb06c
   set_gdbarch_sp_regnum (gdbarch, PPC_R0_REGNUM + 1);