summaryrefslogtreecommitdiffstats
path: root/sim/common/sim-core.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-05-02 08:41:15 +0000
committerAndrew Cagney <cagney@redhat.com>1997-05-02 08:41:15 +0000
commit1fe052808af59da1d2c4718efe8678cb5eabea0a (patch)
treec18c827b6be9e43f2e56c4bfd0c7a8c94cf0948d /sim/common/sim-core.c
parent949fccf66b273ceff1a2d21b3558f24aca17f60d (diff)
downloadppe42-binutils-1fe052808af59da1d2c4718efe8678cb5eabea0a.tar.gz
ppe42-binutils-1fe052808af59da1d2c4718efe8678cb5eabea0a.zip
Update devo version of m32r sim to build with recent sim/common changes.
Diffstat (limited to 'sim/common/sim-core.c')
-rw-r--r--sim/common/sim-core.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c
index 7e41bd98af..0268131e70 100644
--- a/sim/common/sim-core.c
+++ b/sim/common/sim-core.c
@@ -54,7 +54,7 @@ EXTERN_SIM_CORE\
(SIM_RC)
sim_core_init (SIM_DESC sd)
{
- sim_core *memory = &sd->core;
+ sim_core *memory = STATE_CORE(sd);
sim_core_maps map;
for (map = 0;
map < nr_sim_core_maps;
@@ -78,6 +78,20 @@ sim_core_init (SIM_DESC sd)
STATIC_INLINE_SIM_CORE\
+(const char *)
+sim_core_map_to_str (sim_core_maps map)
+{
+ switch (map)
+ {
+ case sim_core_read_map: return "read";
+ case sim_core_write_map: return "write";
+ case sim_core_execute_map: return "exec";
+ default: return "(invalid-map)";
+ }
+}
+
+
+STATIC_INLINE_SIM_CORE\
(sim_core_mapping *)
new_sim_core_mapping(SIM_DESC sd,
attach_type attach,
@@ -186,7 +200,7 @@ sim_core_attach(SIM_DESC sd,
device *client,
void *optional_buffer)
{
- sim_core *memory = &sd->core;
+ sim_core *memory = STATE_CORE(sd);
sim_core_maps map;
void *buffer;
int buffer_freed;
@@ -265,9 +279,11 @@ sim_core_find_mapping(SIM_DESC sd,
sim_core_maps map,
unsigned_word addr,
unsigned nr_bytes,
- int abort) /*either 0 or 1 - helps inline */
+ int abort, /*either 0 or 1 - helps inline */
+ sim_cpu *cpu,
+ sim_cia cia)
{
- sim_core_mapping *mapping = sd->core.map[map].first;
+ sim_core_mapping *mapping = STATE_CORE (sd)->map[map].first;
SIM_ASSERT((addr & (nr_bytes - 1)) == 0); /* must be aligned */
SIM_ASSERT((addr + (nr_bytes - 1)) >= addr); /* must not wrap */
while (mapping != NULL) {
@@ -277,8 +293,8 @@ sim_core_find_mapping(SIM_DESC sd,
mapping = mapping->next;
}
if (abort)
- sim_io_error (sd, "access to unmaped address 0x%x (%d bytes)\n",
- addr, nr_bytes);
+ sim_io_error (sd, "access to unmaped address 0x%lx (%d bytes)\n",
+ (unsigned long) addr, nr_bytes);
return NULL;
}
@@ -306,7 +322,7 @@ sim_core_read_buffer(SIM_DESC sd,
sim_core_mapping *mapping =
sim_core_find_mapping(sd, map,
raddr, 1,
- 0); /*dont-abort*/
+ 0, NULL, NULL_CIA); /*dont-abort*/
if (mapping == NULL)
break;
#if (WITH_DEVICES)
@@ -347,7 +363,7 @@ sim_core_write_buffer(SIM_DESC sd,
unsigned_word raddr = addr + count;
sim_core_mapping *mapping = sim_core_find_mapping(sd, map,
raddr, 1,
- 0); /*dont-abort*/
+ 0, NULL, NULL_CIA); /*dont-abort*/
if (mapping == NULL)
break;
#if (WITH_DEVICES)
OpenPOWER on IntegriCloud