+2015-05-28 Yao Qi <yao.qi@linaro.org>
+
+ * arm-linux-nat.c (arm_linux_has_wmmx_registers): Remove.
+ (arm_linux_fetch_inferior_registers): Use
+ tdep->have_wmmx_registers instead of arm_linux_has_wmmx_registers.
+ (arm_linux_store_inferior_registers): Likewise.
+ (arm_linux_read_description): Don't set
+ arm_linux_has_wmmx_registers.
+ * arm-tdep.c (arm_gdbarch_init): Set
+ tdep->have_wmmx_registers according target descriptions.
+ * arm-tdep.h (struct gdbarch_tdep) <have_wmmx_registers>: New
+ field.
+
2015-05-28 Yao Qi <yao.qi@linaro.org>
* arm-linux-nat.c (arm_linux_vfp_register_count): Remove.
#define PTRACE_SETHBPREGS 30
#endif
-/* A flag for whether the WMMX registers are available. */
-static int arm_linux_has_wmmx_registers;
-
extern int arm_apcs_32;
/* On GNU/Linux, threads are implemented as pseudo-processes, in which
{
fetch_regs (regcache);
fetch_fpregs (regcache);
- if (arm_linux_has_wmmx_registers)
+ if (tdep->have_wmmx_registers)
fetch_wmmx_regs (regcache);
if (tdep->vfp_register_count > 0)
fetch_vfp_regs (regcache);
fetch_register (regcache, regno);
else if (regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM)
fetch_fpregister (regcache, regno);
- else if (arm_linux_has_wmmx_registers
+ else if (tdep->have_wmmx_registers
&& regno >= ARM_WR0_REGNUM && regno <= ARM_WCGR7_REGNUM)
fetch_wmmx_regs (regcache);
else if (tdep->vfp_register_count > 0
{
store_regs (regcache);
store_fpregs (regcache);
- if (arm_linux_has_wmmx_registers)
+ if (tdep->have_wmmx_registers)
store_wmmx_regs (regcache);
if (tdep->vfp_register_count > 0)
store_vfp_regs (regcache);
store_register (regcache, regno);
else if ((regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM))
store_fpregister (regcache, regno);
- else if (arm_linux_has_wmmx_registers
+ else if (tdep->have_wmmx_registers
&& regno >= ARM_WR0_REGNUM && regno <= ARM_WCGR7_REGNUM)
store_wmmx_regs (regcache);
else if (tdep->vfp_register_count > 0
arm_linux_read_description (struct target_ops *ops)
{
CORE_ADDR arm_hwcap = 0;
- arm_linux_has_wmmx_registers = 0;
if (target_auxv_search (ops, AT_HWCAP, &arm_hwcap) != 1)
{
}
if (arm_hwcap & HWCAP_IWMMXT)
- {
- arm_linux_has_wmmx_registers = 1;
- return tdesc_arm_with_iwmmxt;
- }
+ return tdesc_arm_with_iwmmxt;
if (arm_hwcap & HWCAP_VFP)
{
struct tdesc_arch_data *tdesc_data = NULL;
int i, is_m = 0;
int vfp_register_count = 0, have_vfp_pseudos = 0, have_neon_pseudos = 0;
+ int have_wmmx_registers = 0;
int have_neon = 0;
int have_fpa_registers = 1;
const struct target_desc *tdesc = info.target_desc;
tdesc_data_cleanup (tdesc_data);
return NULL;
}
+
+ have_wmmx_registers = 1;
}
/* If we have a VFP unit, check whether the single precision registers
tdep->fp_model = fp_model;
tdep->is_m = is_m;
tdep->have_fpa_registers = have_fpa_registers;
+ tdep->have_wmmx_registers = have_wmmx_registers;
gdb_assert (vfp_register_count == 0
|| vfp_register_count == 16
|| vfp_register_count == 32);