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
This commit is contained in:
Mike Frysinger
2022-11-12 01:15:32 +07:00
parent 20fea6638f
commit 63fd5b5dda
14 changed files with 64 additions and 60 deletions

View File

@@ -158,8 +158,8 @@ sim_create_inferior (SIM_DESC sd, struct bfd * abfd,
return SIM_RC_OK;
}
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)
{
check_desc (sd);
@@ -171,8 +171,8 @@ sim_read (SIM_DESC sd, SIM_ADDR mem, void *buf, int length)
return length;
}
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)
{
check_desc (sd);