summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-21 00:10:22 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-22 19:41:00 -0400
commit072d63a871cbee4a132974a9b922d95b0f64d221 (patch)
tree0adaed0a38bf47db8927f7c90ff1f9bb12b0524f
parent13b0d6e5a2d1f5d8580dfcb52d9496eb04cf2ca1 (diff)
downloadbinutils-gdb-072d63a871cbee4a132974a9b922d95b0f64d221.tar.gz
sim: cris: fix a few warnings
Include header for hw funcs called, adjust prototype to match the args given to it, and adjust cast to match the function.
-rw-r--r--sim/cris/ChangeLog6
-rw-r--r--sim/cris/sim-if.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index d31f91e0a26..78b106535ba 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,5 +1,11 @@
2021-06-22 Mike Frysinger <vapier@gentoo.org>
+ * sim-if.c: Include sim-hw.h.
+ (cris_write_interp): Change buf to const.
+ (sim_open): Cast sp_init to unsigned char *.
+
+2021-06-22 Mike Frysinger <vapier@gentoo.org>
+
* configure: Regenerate.
2021-06-21 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index c183856fa4c..99249393521 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
#include "sim-options.h"
+#include "sim-hw.h"
#include "dis-asm.h"
#include "environ.h"
@@ -478,7 +479,7 @@ aux_ent_entry (struct bfd *ebfd)
interp_load_addr offset. */
static int
-cris_write_interp (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
+cris_write_interp (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
{
return sim_write (sd, mem + interp_load_addr, buf, length);
}
@@ -917,7 +918,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
CPU_CRIS_MISC_PROFILE (cpu)->flags = STATE_TRACE_FLAGS (sd)[0];
/* Set SP to the stack we allocated above. */
- (* CPU_REG_STORE (cpu)) (cpu, H_GR_SP, (char *) sp_init, 4);
+ (* CPU_REG_STORE (cpu)) (cpu, H_GR_SP, (unsigned char *) sp_init, 4);
/* Set the simulator environment data. */
cpu->highest_mmapped_page = NULL;