From 5bab16fdf1775c8abd16376458c5843fbe1d4314 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 26 Oct 2022 23:01:21 +0545 Subject: sim: reg: constify store helper These functions only read from memory, so mark the pointer as const. --- sim/or1k/or1k-sim.h | 4 ++-- sim/or1k/or1k.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sim/or1k') diff --git a/sim/or1k/or1k-sim.h b/sim/or1k/or1k-sim.h index c956a05..045f171 100644 --- a/sim/or1k/or1k-sim.h +++ b/sim/or1k/or1k-sim.h @@ -70,8 +70,8 @@ void or1k32bf_mtspr (sim_cpu *current_cpu, USI addr, USI val); int or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf, int len); -int or1k32bf_store_register (sim_cpu *current_cpu, int rn, unsigned char *buf, - int len); +int or1k32bf_store_register (sim_cpu *current_cpu, int rn, + const unsigned char *buf, int len); int or1k32bf_model_or1200_u_exec (sim_cpu *current_cpu, const IDESC *idesc, int unit_num, int referenced); int or1k32bf_model_or1200nd_u_exec (sim_cpu *current_cpu, const IDESC *idesc, diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c index bfab354..488d756 100644 --- a/sim/or1k/or1k.c +++ b/sim/or1k/or1k.c @@ -55,7 +55,7 @@ or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf, } int -or1k32bf_store_register (sim_cpu *current_cpu, int rn, unsigned char *buf, +or1k32bf_store_register (sim_cpu *current_cpu, int rn, const unsigned char *buf, int len) { if (rn < 32) -- cgit v1.1