+2017-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and
+ s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml,
+ s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to
+ srv_xmlfiles. Add s390-gs-linux64-ipa.o and
+ s390x-gs-linux64-ipa.o to ipa_obj.
+ * linux-s390-low.c (HWCAP_S390_GS): New define.
+ (s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc):
+ New functions.
+ (s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC.
+ (s390_arch_setup): Check for guarded-storage support and choose
+ appropriate tdesc.
+ (initialize_low_arch): Invoke init_registers_s390_gs_linux64 and
+ init_registers_s390x_gs_linux64.
+ * linux-s390-tdesc.h (enum s390_linux_tdesc) <S390_TDESC_GS>: New
+ enum value.
+ (init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64)
+ (init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare.
+
2017-09-22 Simon Marchi <simon.marchi@ericsson.com>
* win32-i386-low.c (i386_arch_setup): Call init_target_desc.
srv_regobj="${srv_regobj} s390-te-linux64.o"
srv_regobj="${srv_regobj} s390-vx-linux64.o"
srv_regobj="${srv_regobj} s390-tevx-linux64.o"
+ srv_regobj="${srv_regobj} s390-gs-linux64.o"
srv_regobj="${srv_regobj} s390x-linux64.o"
srv_regobj="${srv_regobj} s390x-linux64v1.o"
srv_regobj="${srv_regobj} s390x-linux64v2.o"
srv_regobj="${srv_regobj} s390x-te-linux64.o"
srv_regobj="${srv_regobj} s390x-vx-linux64.o"
srv_regobj="${srv_regobj} s390x-tevx-linux64.o"
+ srv_regobj="${srv_regobj} s390x-gs-linux64.o"
srv_tgtobj="$srv_linux_obj linux-s390-low.o"
srv_xmlfiles="s390-linux32.xml"
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
srv_xmlfiles="${srv_xmlfiles} s390-te-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390-vx-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390-tevx-linux64.xml"
+ srv_xmlfiles="${srv_xmlfiles} s390-gs-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v1.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-linux64v2.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-te-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-vx-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-tevx-linux64.xml"
+ srv_xmlfiles="${srv_xmlfiles} s390x-gs-linux64.xml"
srv_xmlfiles="${srv_xmlfiles} s390-core32.xml"
srv_xmlfiles="${srv_xmlfiles} s390-core64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml"
srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml"
srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml"
srv_xmlfiles="${srv_xmlfiles} s390-vx.xml"
+ srv_xmlfiles="${srv_xmlfiles} s390-gs.xml"
+ srv_xmlfiles="${srv_xmlfiles} s390-gsbc.xml"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
ipa_obj="${ipa_obj} s390-vx-linux64-ipa.o"
ipa_obj="${ipa_obj} s390-te-linux64-ipa.o"
ipa_obj="${ipa_obj} s390-tevx-linux64-ipa.o"
+ ipa_obj="${ipa_obj} s390-gs-linux64-ipa.o"
ipa_obj="${ipa_obj} s390x-linux64-ipa.o"
ipa_obj="${ipa_obj} s390x-linux64v1-ipa.o"
ipa_obj="${ipa_obj} s390x-linux64v2-ipa.o"
ipa_obj="${ipa_obj} s390x-vx-linux64-ipa.o"
ipa_obj="${ipa_obj} s390x-te-linux64-ipa.o"
ipa_obj="${ipa_obj} s390x-tevx-linux64-ipa.o"
+ ipa_obj="${ipa_obj} s390x-gs-linux64-ipa.o"
;;
sh*-*-linux*) srv_regobj=reg-sh.o
srv_tgtobj="$srv_linux_obj linux-sh-low.o"
#define HWCAP_S390_VX 2048
#endif
+#ifndef HWCAP_S390_GS
+#define HWCAP_S390_GS 16384
+#endif
+
#define s390_num_regs 52
static int s390_regmap[] = {
supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
}
+static void
+s390_fill_gs (struct regcache *regcache, void *buf)
+{
+ int gsd = find_regno (regcache->tdesc, "gsd");
+ int i;
+
+ for (i = 0; i < 3; i++)
+ collect_register (regcache, gsd + i, (char *) buf + 8 * (i + 1));
+}
+
+static void
+s390_store_gs (struct regcache *regcache, const void *buf)
+{
+ int gsd = find_regno (regcache->tdesc, "gsd");
+ int i;
+
+ for (i = 0; i < 3; i++)
+ supply_register (regcache, gsd + i, (const char *) buf + 8 * (i + 1));
+}
+
+static void
+s390_fill_gsbc (struct regcache *regcache, void *buf)
+{
+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd");
+ int i;
+
+ for (i = 0; i < 3; i++)
+ collect_register (regcache, bc_gsd + i, (char *) buf + 8 * (i + 1));
+}
+
+static void
+s390_store_gsbc (struct regcache *regcache, const void *buf)
+{
+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd");
+ int i;
+
+ for (i = 0; i < 3; i++)
+ supply_register (regcache, bc_gsd + i, (const char *) buf + 8 * (i + 1));
+}
+
static struct regset_info s390_regsets[] = {
{ 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
#ifndef __s390x__
EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low },
{ PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0,
EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high },
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_CB, 0,
+ EXTENDED_REGS, s390_fill_gs, s390_store_gs },
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_BC, 0,
+ EXTENDED_REGS, s390_fill_gsbc, s390_store_gsbc },
NULL_REGSET
};
int have_regset_tdb = s390_check_regset (pid, NT_S390_TDB, 256);
int have_regset_vxrs = s390_check_regset (pid, NT_S390_VXRS_LOW, 128)
&& s390_check_regset (pid, NT_S390_VXRS_HIGH, 256);
+ int have_regset_gs = s390_check_regset (pid, NT_S390_GS_CB, 32)
+ && s390_check_regset (pid, NT_S390_GS_BC, 32);
/* Assume 31-bit inferior process. */
if (have_regset_system_call)
if (have_regset_vxrs)
have_regset_vxrs =
(s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0;
+ if (have_regset_gs)
+ have_regset_gs =
+ (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_GS) != 0;
- if (have_regset_vxrs)
+ if (have_regset_gs)
+ tdesc = tdesc_s390x_gs_linux64;
+ else if (have_regset_vxrs)
tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
tdesc_s390x_vx_linux64);
else if (have_regset_tdb)
have_regset_tdb = (s390_get_hwcap (tdesc) & HWCAP_S390_TE) != 0;
if (have_regset_vxrs)
have_regset_vxrs = (s390_get_hwcap (tdesc) & HWCAP_S390_VX) != 0;
+ if (have_regset_gs)
+ have_regset_gs = (s390_get_hwcap (tdesc) & HWCAP_S390_GS) != 0;
- if (have_regset_vxrs)
+ if (have_regset_gs)
+ tdesc = tdesc_s390_gs_linux64;
+ else if (have_regset_vxrs)
tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 :
tdesc_s390_vx_linux64);
else if (have_regset_tdb)
case NT_S390_VXRS_HIGH:
regset->size = have_regset_vxrs ? 256 : 0;
break;
+ case NT_S390_GS_CB:
+ case NT_S390_GS_BC:
+ regset->size = have_regset_gs ? 32 : 0;
default:
break;
}
init_registers_s390_te_linux64 ();
init_registers_s390_vx_linux64 ();
init_registers_s390_tevx_linux64 ();
+ init_registers_s390_gs_linux64 ();
#ifdef __s390x__
init_registers_s390x_linux64 ();
init_registers_s390x_linux64v1 ();
init_registers_s390x_te_linux64 ();
init_registers_s390x_vx_linux64 ();
init_registers_s390x_tevx_linux64 ();
+ init_registers_s390x_gs_linux64 ();
#endif
initialize_regsets_info (&s390_regsets_info);