summaryrefslogtreecommitdiff
path: root/sim/mn10300
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-26 23:01:21 +0545
committerMike Frysinger <vapier@gentoo.org>2022-10-31 21:24:39 +0545
commit5bab16fdf1775c8abd16376458c5843fbe1d4314 (patch)
tree0b41c08b25c87525ba53362fca775a7d6acb6599 /sim/mn10300
parented60d3edd51f6c33fb0f3f09400094a1b1c2ceb2 (diff)
downloadbinutils-gdb-5bab16fdf1775c8abd16376458c5843fbe1d4314.tar.gz
sim: reg: constify store helper
These functions only read from memory, so mark the pointer as const.
Diffstat (limited to 'sim/mn10300')
-rw-r--r--sim/mn10300/interp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 2e7fd163047..020fd04d67c 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -80,7 +80,7 @@ mn10300_pc_set (sim_cpu *cpu, sim_cia pc)
}
static int mn10300_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int mn10300_reg_store (SIM_CPU *, int, unsigned char *, int);
+static int mn10300_reg_store (SIM_CPU *, int, const unsigned char *, int);
/* These default values correspond to expected usage for the chip. */
@@ -344,9 +344,9 @@ mn10300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
}
static int
-mn10300_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+mn10300_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
{
- uint8_t *a = memory;
+ const uint8_t *a = memory;
State.regs[rn] = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0];
return length;
}