From 63fd5b5ddad9c715531168d5863853017a1f02d3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 12 Nov 2022 01:15:32 +0700 Subject: 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 --- sim/d10v/interp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sim/d10v') diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index f83fa66..ae8b670 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -664,9 +664,9 @@ map_memory (SIM_DESC sd, SIM_CPU *cpu, unsigned phys_addr) static int xfer_mem (SIM_DESC sd, - SIM_ADDR virt, + address_word virt, unsigned char *buffer, - int size, + uint64_t size, int write_p) { uint8_t *memory; @@ -705,8 +705,8 @@ xfer_mem (SIM_DESC sd, } -int -sim_write (SIM_DESC sd, SIM_ADDR addr, const void *buffer, int size) +uint64_t +sim_write (SIM_DESC sd, uint64_t addr, const void *buffer, uint64_t size) { /* FIXME: this should be performing a virtual transfer */ /* FIXME: We cast the const away, but it's safe because xfer_mem only reads @@ -714,8 +714,8 @@ sim_write (SIM_DESC sd, SIM_ADDR addr, const void *buffer, int size) return xfer_mem (sd, addr, (void *) buffer, size, 1); } -int -sim_read (SIM_DESC sd, SIM_ADDR addr, void *buffer, int size) +uint64_t +sim_read (SIM_DESC sd, uint64_t addr, void *buffer, uint64_t size) { /* FIXME: this should be performing a virtual transfer */ return xfer_mem (sd, addr, buffer, size, 0); -- cgit v1.1