aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-12 01:15:32 +0700
committerMike Frysinger <vapier@gentoo.org>2022-12-22 19:29:24 -0500
commit63fd5b5ddad9c715531168d5863853017a1f02d3 (patch)
tree0ede0e8d44166303d4b451dfc30e096e82e5d505 /sim/ppc
parent20fea6638f1785b241c39454dcb707234a675524 (diff)
downloadfsf-binutils-gdb-63fd5b5ddad9c715531168d5863853017a1f02d3.zip
fsf-binutils-gdb-63fd5b5ddad9c715531168d5863853017a1f02d3.tar.gz
fsf-binutils-gdb-63fd5b5ddad9c715531168d5863853017a1f02d3.tar.bz2
sim: switch sim_{read,write} APIs to 64-bit all the time [PR sim/7504]
We've been using SIM_ADDR which has always been 32-bit. This means the upper 32-bit address range in 64-bit sims is inaccessible. Use 64-bit addresses all the time since we want the APIs to be stable regardless of the active arch backend (which can be 32 or 64-bit). The length is also 64-bit because it's completely feasible to have a program that is larger than 4 GiB in size/image/runtime. Forcing the caller to manually chunk those accesses up into 4 GiB at a time doesn't seem useful to anyone. Bug: https://sourceware.org/PR7504
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/sim_calls.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 6ca6c2c..8854445 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -124,25 +124,27 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
}
-int
-sim_read (SIM_DESC sd, SIM_ADDR mem, void *buf, int length)
+uint64_t
+sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
{
int result = psim_read_memory(simulator, MAX_NR_PROCESSORS,
buf, mem, length);
- TRACE(trace_gdb, ("sim_read(mem=0x%lx, buf=%p, length=%d) = %d\n",
- (long)mem, buf, length, result));
+ TRACE(trace_gdb,
+ ("sim_read(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
+ mem, buf, length, result));
return result;
}
-int
-sim_write (SIM_DESC sd, SIM_ADDR mem, const void *buf, int length)
+uint64_t
+sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length)
{
int result = psim_write_memory(simulator, MAX_NR_PROCESSORS,
buf, mem, length,
1/*violate_ro*/);
- TRACE(trace_gdb, ("sim_write(mem=0x%lx, buf=%p, length=%d) = %d\n",
- (long)mem, buf, length, result));
+ TRACE(trace_gdb,
+ ("sim_write(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
+ mem, buf, length, result));
return result;
}