+2020-09-18 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * m32r.c (m32rbf_register_size): New function.
+ (m32rbf_fetch_register): Use new function.
+ (m32rbf_store_register): Likewise.
+
2017-09-06 John Baldwin <jhb@FreeBSD.org>
* configure: Regenerate.
#include "cgen-mem.h"
#include "cgen-ops.h"
+/* Return the size of REGNO in bytes. */
+
+static int
+m32rbf_register_size (int regno)
+{
+ return 4;
+}
+
/* Decode gdb ctrl register number. */
int
int
m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
{
+ int size = m32rbf_register_size (rn);
+ if (len != size)
+ return -1;
+
if (rn < 16)
SETTWI (buf, m32rbf_h_gr_get (current_cpu, rn));
else
return 0;
}
- return -1; /*FIXME*/
+ return size;
}
/* The contents of BUF are in target byte order. */
int
m32rbf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
{
+ int size = m32rbf_register_size (rn);
+ if (len != size)
+ return -1;
+
if (rn < 16)
m32rbf_h_gr_set (current_cpu, rn, GETTWI (buf));
else
return 0;
}
- return -1; /*FIXME*/
+ return size;
}
\f
USI