@@ -27,17 +27,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
modeling real hardware */
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buffer, uint64_t length)
{
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
return sim_core_read_buffer (sd, NULL, read_map,
- buffer, mem, length);
+ buffer, addr, length);
}
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buffer, uint64_t length)
{
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
return sim_core_write_buffer (sd, NULL, write_map,
- buffer, mem, length);
+ buffer, addr, length);
}
@@ -330,25 +330,25 @@ sim_fetch_register(SIM_DESC sd, int regno, void *buf, int length)
}
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buffer, uint64_t length)
{
int i;
const unsigned char *data = buffer;
for (i = 0; i < length; i++) {
- sis_memory_write ((mem + i) ^ EBT, &data[i], 1);
+ sis_memory_write ((addr + i) ^ EBT, &data[i], 1);
}
return length;
}
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buffer, uint64_t length)
{
int i;
unsigned char *data = buffer;
for (i = 0; i < length; i++) {
- sis_memory_read ((mem + i) ^ EBT, &data[i], 1);
+ sis_memory_read ((addr + i) ^ EBT, &data[i], 1);
}
return length;
}
@@ -159,24 +159,24 @@ sim_create_inferior (SIM_DESC sd, struct bfd * abfd,
}
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buf, uint64_t length)
{
check_desc (sd);
- if (mem == 0)
+ if (addr == 0)
return 0;
- mem_get_blk ((int) mem, buf, length);
+ mem_get_blk ((int) addr, buf, length);
return length;
}
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buf, uint64_t length)
{
check_desc (sd);
- mem_put_blk ((int) mem, buf, length);
+ mem_put_blk ((int) addr, buf, length);
return length;
}
@@ -125,26 +125,26 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buf, uint64_t length)
{
int result = psim_read_memory(simulator, MAX_NR_PROCESSORS,
- buf, mem, length);
+ buf, addr, length);
TRACE(trace_gdb,
- ("sim_read(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
- mem, buf, length, result));
+ ("sim_read(addr=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
+ addr, buf, length, result));
return result;
}
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buf, uint64_t length)
{
int result = psim_write_memory(simulator, MAX_NR_PROCESSORS,
- buf, mem, length,
+ buf, addr, length,
1/*violate_ro*/);
TRACE(trace_gdb,
- ("sim_write(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
- mem, buf, length, result));
+ ("sim_write(addr=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n",
+ addr, buf, length, result));
return result;
}
@@ -205,32 +205,32 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
/* Read memory. */
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buf, uint64_t length)
{
check_desc (sd);
- if (mem >= MEM_SIZE)
+ if (addr >= MEM_SIZE)
return 0;
- else if (mem + length > MEM_SIZE)
- length = MEM_SIZE - mem;
+ else if (addr + length > MEM_SIZE)
+ length = MEM_SIZE - addr;
- mem_get_blk (mem, buf, length);
+ mem_get_blk (addr, buf, length);
return length;
}
/* Write memory. */
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buf, uint64_t length)
{
check_desc (sd);
- if (mem >= MEM_SIZE)
+ if (addr >= MEM_SIZE)
return 0;
- else if (mem + length > MEM_SIZE)
- length = MEM_SIZE - mem;
+ else if (addr + length > MEM_SIZE)
+ length = MEM_SIZE - addr;
- mem_put_blk (mem, buf, length);
+ mem_put_blk (addr, buf, length);
return length;
}
@@ -227,23 +227,23 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
}
uint64_t
-sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
+sim_read (SIM_DESC sd, uint64_t addr, void *buffer, uint64_t length)
{
int i;
unsigned char *data = buffer;
check_desc (sd);
- if (mem == 0)
+ if (addr == 0)
return 0;
execution_error_clear_last_error ();
for (i = 0; i < length; i++)
{
- bfd_vma addr = mem + i;
- int do_swap = addr_in_swap_list (addr);
- data[i] = mem_get_qi (addr ^ (do_swap ? 3 : 0));
+ bfd_vma vma = addr + i;
+ int do_swap = addr_in_swap_list (vma);
+ data[i] = mem_get_qi (vma ^ (do_swap ? 3 : 0));
if (execution_error_get_last_error () != SIM_ERR_NONE)
return i;
@@ -253,7 +253,7 @@ sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
}
uint64_t
-sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length)
+sim_write (SIM_DESC sd, uint64_t addr, const void *buffer, uint64_t length)
{
int i;
const unsigned char *data = buffer;
@@ -264,9 +264,9 @@ sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length)
for (i = 0; i < length; i++)
{
- bfd_vma addr = mem + i;
- int do_swap = addr_in_swap_list (addr);
- mem_put_qi (addr ^ (do_swap ? 3 : 0), data[i]);
+ bfd_vma vma = addr + i;
+ int do_swap = addr_in_swap_list (vma);
+ mem_put_qi (vma ^ (do_swap ? 3 : 0), data[i]);
if (execution_error_get_last_error () != SIM_ERR_NONE)
return i;