+2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
+ (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
+ (clean): Add "rm -f" for above C files.
+ * configure.srv (srv_regobj): Add s390-vx-linux64.o,
+ s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
+ (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
+ s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
+ * linux-s390-low.c (HWCAP_S390_VX): New macro.
+ (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
+ (init_registers_s390x_vx_linux64)
+ (init_registers_s390x_tevx_linux64)
+ (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
+ (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
+ declarations.
+ (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
+ (s390_store_vxrs_high): New functions.
+ (s390_regsets): Add entries for NT_S390_VXRS_LOW and
+ NT_S390_VXRS_HIGH.
+ (s390_arch_setup): Add logic for selecting one of the new target
+ descriptions. Activate the new vector regsets if applicable.
+ (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
+ init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
+ and init_registers_s390x_tevx_linux64.
+
2015-03-01 Pedro Alves <palves@redhat.com>
* linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
rm -f s390-linux32.c s390-linux64.c s390x-linux64.c
rm -f s390-linux32v1.c s390-linux32v2.c s390-linux64v1.c
rm -f s390-linux64v2.c s390x-linux64v1.c s390x-linux64v2.c
- rm -f s390-te-linux32.c s390-te-linux64.c
+ rm -f s390-te-linux64.c s390x-te-linux64.c
+ rm -f s390-vx-linux64.c s390x-vx-linux64.c
+ rm -f s390-tevx-linux64.c s390x-tevx-linux64.c
rm -f tic6x-c64xp-linux.c tic6x-c64x-linux.c tic6x-c62x-linux.c
rm -f xml-builtin.c stamp-xml
rm -f i386-avx.c i386-avx-linux.c
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-linux64v2.dat s390-linux64v2.c
s390-te-linux64.c : $(srcdir)/../regformats/s390-te-linux64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-te-linux64.dat s390-te-linux64.c
+s390-vx-linux64.c : $(srcdir)/../regformats/s390-vx-linux64.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-vx-linux64.dat s390-vx-linux64.c
+s390-tevx-linux64.c : $(srcdir)/../regformats/s390-tevx-linux64.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-tevx-linux64.dat s390-tevx-linux64.c
s390x-linux64.c : $(srcdir)/../regformats/s390x-linux64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-linux64.dat s390x-linux64.c
s390x-linux64v1.c : $(srcdir)/../regformats/s390x-linux64v1.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-linux64v2.dat s390x-linux64v2.c
s390x-te-linux64.c : $(srcdir)/../regformats/s390x-te-linux64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-te-linux64.dat s390x-te-linux64.c
+s390x-vx-linux64.c : $(srcdir)/../regformats/s390x-vx-linux64.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-vx-linux64.dat s390x-vx-linux64.c
+s390x-tevx-linux64.c : $(srcdir)/../regformats/s390x-tevx-linux64.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-tevx-linux64.dat s390x-tevx-linux64.c
tic6x-c64xp-linux.c : $(srcdir)/../regformats/tic6x-c64xp-linux.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/tic6x-c64xp-linux.dat tic6x-c64xp-linux.c
srv_regobj="${srv_regobj} s390-linux64v1.o"
srv_regobj="${srv_regobj} s390-linux64v2.o"
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} 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_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-linux64v1.xml"
srv_xmlfiles="${srv_xmlfiles} s390-linux64v2.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} 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} s390-core32.xml"
srv_xmlfiles="${srv_xmlfiles} s390-core64.xml"
srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml"
srv_xmlfiles="${srv_xmlfiles} s390-acr.xml"
srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml"
srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml"
+ srv_xmlfiles="${srv_xmlfiles} s390-vx.xml"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
#define HWCAP_S390_TE 1024
#endif
+#ifndef HWCAP_S390_VX
+#define HWCAP_S390_VX 2048
+#endif
+
#ifndef PTRACE_GETREGSET
#define PTRACE_GETREGSET 0x4204
#endif
void init_registers_s390_te_linux64 (void);
extern const struct target_desc *tdesc_s390_te_linux64;
+/* Defined in auto-generated file s390-vx-linux64.c. */
+void init_registers_s390_vx_linux64 (void);
+extern const struct target_desc *tdesc_s390_vx_linux64;
+
+/* Defined in auto-generated file s390-tevx-linux64.c. */
+void init_registers_s390_tevx_linux64 (void);
+extern const struct target_desc *tdesc_s390_tevx_linux64;
+
/* Defined in auto-generated file s390x-linux64.c. */
void init_registers_s390x_linux64 (void);
extern const struct target_desc *tdesc_s390x_linux64;
void init_registers_s390x_te_linux64 (void);
extern const struct target_desc *tdesc_s390x_te_linux64;
+/* Defined in auto-generated file s390x-vx-linux64.c. */
+void init_registers_s390x_vx_linux64 (void);
+extern const struct target_desc *tdesc_s390x_vx_linux64;
+
+/* Defined in auto-generated file s390x-tevx-linux64.c. */
+void init_registers_s390x_tevx_linux64 (void);
+extern const struct target_desc *tdesc_s390x_tevx_linux64;
+
#define s390_num_regs 52
static int s390_regmap[] = {
supply_register (regcache, tr0 + i, (const char *) buf + 8 * (16 + i));
}
+static void
+s390_fill_vxrs_low (struct regcache *regcache, void *buf)
+{
+ int v0 = find_regno (regcache->tdesc, "v0l");
+ int i;
+
+ for (i = 0; i < 16; i++)
+ collect_register (regcache, v0 + i, (char *) buf + 8 * i);
+}
+
+static void
+s390_store_vxrs_low (struct regcache *regcache, const void *buf)
+{
+ int v0 = find_regno (regcache->tdesc, "v0l");
+ int i;
+
+ for (i = 0; i < 16; i++)
+ supply_register (regcache, v0 + i, (const char *) buf + 8 * i);
+}
+
+static void
+s390_fill_vxrs_high (struct regcache *regcache, void *buf)
+{
+ int v16 = find_regno (regcache->tdesc, "v16");
+ int i;
+
+ for (i = 0; i < 16; i++)
+ collect_register (regcache, v16 + i, (char *) buf + 16 * i);
+}
+
+static void
+s390_store_vxrs_high (struct regcache *regcache, const void *buf)
+{
+ int v16 = find_regno (regcache->tdesc, "v16");
+ int i;
+
+ for (i = 0; i < 16; i++)
+ supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
+}
+
static struct regset_info s390_regsets[] = {
{ 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
/* Last break address is read-only; no fill function. */
/* TDB is read-only. */
{ PTRACE_GETREGSET, -1, NT_S390_TDB, 0, EXTENDED_REGS,
NULL, s390_store_tdb },
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_LOW, 0,
+ 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 },
{ 0, 0, 0, -1, -1, NULL, NULL }
};
int have_regset_system_call
= s390_check_regset (pid, NT_S390_SYSTEM_CALL, 4);
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);
/* Assume 31-bit inferior process. */
if (have_regset_system_call)
if (have_regset_tdb)
have_regset_tdb =
(s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_TE) != 0;
-
- if (have_regset_tdb)
+ if (have_regset_vxrs)
+ have_regset_vxrs =
+ (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0;
+
+ if (have_regset_vxrs)
+ tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
+ tdesc_s390x_vx_linux64);
+ else if (have_regset_tdb)
tdesc = tdesc_s390x_te_linux64;
else if (have_regset_system_call)
tdesc = tdesc_s390x_linux64v2;
have_hwcap_s390_high_gprs = 1;
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_tdb)
+ if (have_regset_vxrs)
+ tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 :
+ tdesc_s390_vx_linux64);
+ else if (have_regset_tdb)
tdesc = tdesc_s390_te_linux64;
else if (have_regset_system_call)
tdesc = tdesc_s390_linux64v2;
break;
case NT_S390_TDB:
regset->size = have_regset_tdb ? 256 : 0;
+ break;
+ case NT_S390_VXRS_LOW:
+ regset->size = have_regset_vxrs ? 128 : 0;
+ break;
+ case NT_S390_VXRS_HIGH:
+ regset->size = have_regset_vxrs ? 256 : 0;
+ break;
default:
break;
}
init_registers_s390_linux64v1 ();
init_registers_s390_linux64v2 ();
init_registers_s390_te_linux64 ();
+ init_registers_s390_vx_linux64 ();
+ init_registers_s390_tevx_linux64 ();
init_registers_s390x_linux64 ();
init_registers_s390x_linux64v1 ();
init_registers_s390x_linux64v2 ();
init_registers_s390x_te_linux64 ();
+ init_registers_s390x_vx_linux64 ();
+ init_registers_s390x_tevx_linux64 ();
initialize_regsets_info (&s390_regsets_info);
#ifdef __s390x__