@@ -222,6 +222,9 @@ struct gdbarch_tdep
struct ctype_cache *type_entries;
};
+/* Big enough to hold the size of the largest register in bytes. */
+#define XTENSA_MAX_REGISTER_SIZE 16
+
/* Macro to instantiate a gdbarch_tdep structure. */
#define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz) \
@@ -370,7 +370,7 @@ static void
xtensa_register_write_masked (struct regcache *regcache,
xtensa_register_t *reg, const gdb_byte *buffer)
{
- unsigned int value[(MAX_REGISTER_SIZE + 3) / 4];
+ unsigned int value[(XTENSA_MAX_REGISTER_SIZE + 3) / 4];
const xtensa_mask_t *mask = reg->mask;
int shift = 0; /* Shift for next mask (mod 32). */
@@ -454,7 +454,7 @@ static enum register_status
xtensa_register_read_masked (struct regcache *regcache,
xtensa_register_t *reg, gdb_byte *buffer)
{
- unsigned int value[(MAX_REGISTER_SIZE + 3) / 4];
+ unsigned int value[(XTENSA_MAX_REGISTER_SIZE + 3) / 4];
const xtensa_mask_t *mask = reg->mask;
int shift = 0;
@@ -559,7 +559,7 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
&& (regnum >= gdbarch_tdep (gdbarch)->a0_base)
&& (regnum <= gdbarch_tdep (gdbarch)->a0_base + 15))
{
- gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
+ gdb_byte *buf = (gdb_byte *) alloca (XTENSA_MAX_REGISTER_SIZE);
enum register_status status;
status = regcache_raw_read (regcache,
@@ -655,7 +655,7 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
&& (regnum >= gdbarch_tdep (gdbarch)->a0_base)
&& (regnum <= gdbarch_tdep (gdbarch)->a0_base + 15))
{
- gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
+ gdb_byte *buf = (gdb_byte *) alloca (XTENSA_MAX_REGISTER_SIZE);
regcache_raw_read (regcache,
gdbarch_tdep (gdbarch)->wb_regnum, buf);