summaryrefslogtreecommitdiff
path: root/sim/m32c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-04-14 07:38:03 +0000
committerMike Frysinger <vapier@gentoo.org>2010-04-14 07:38:03 +0000
commita3960ae0be37da1d6e57a748129c0d9effa77400 (patch)
tree037cea88f2fc80192a4dab909050d5fce56a9757 /sim/m32c
parentf80965c8b03b9ca637edcc810d70011ac5dfc3d9 (diff)
downloadgdb-a3960ae0be37da1d6e57a748129c0d9effa77400.tar.gz
sim: constify sim_write source buffer (part 2)
As pointed out by Sandra Loosemore, a bunch of targets define sim_write themselves instead of using the common/ code. So constify them too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/m32c')
-rw-r--r--sim/m32c/ChangeLog6
-rw-r--r--sim/m32c/gdb-if.c2
-rw-r--r--sim/m32c/mem.c4
-rw-r--r--sim/m32c/mem.h2
4 files changed, 10 insertions, 4 deletions
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index e443c162da2..982793734d6 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-14 Mike Frysinger <vapier@gentoo.org>
+
+ * gdb-if.c (sim_write): Add const to buf arg.
+ * mem.h (mem_put_blk): Add const to bufptr arg.
+ * mem.c (mem_put_blk): Likewise, and add const to cast.
+
2010-01-20 DJ Delorie <dj@redhat.com>
* m32c.opc (MATH_OP): When doing subtraction, also set carry if
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index c44c7ec7659..fb943f5d956 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -167,7 +167,7 @@ sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
}
int
-sim_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
+sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
{
check_desc (sd);
diff --git a/sim/m32c/mem.c b/sim/m32c/mem.c
index c25b9637d7e..02604d59177 100644
--- a/sim/m32c/mem.c
+++ b/sim/m32c/mem.c
@@ -365,13 +365,13 @@ mem_put_si (int address, unsigned long value)
}
void
-mem_put_blk (int address, void *bufptr, int nbytes)
+mem_put_blk (int address, const void *bufptr, int nbytes)
{
S ("<=");
if (enable_counting)
mem_counters[1][1] += nbytes;
while (nbytes--)
- mem_put_byte (address++, *(unsigned char *) bufptr++);
+ mem_put_byte (address++, *(const unsigned char *) bufptr++);
E ();
}
diff --git a/sim/m32c/mem.h b/sim/m32c/mem.h
index 5caef25edff..a36a389a950 100644
--- a/sim/m32c/mem.h
+++ b/sim/m32c/mem.h
@@ -27,7 +27,7 @@ void mem_put_hi (int address, unsigned short value);
void mem_put_psi (int address, unsigned long value);
void mem_put_si (int address, unsigned long value);
-void mem_put_blk (int address, void *bufptr, int nbytes);
+void mem_put_blk (int address, const void *bufptr, int nbytes);
unsigned char mem_get_pc ();