aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r/sim-if.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
commit247fccdeb54a09a14287b2e829511803ad9d7cc1 (patch)
treec992df7132ca0c315cbcfd5ad81bbc4f16675936 /sim/m32r/sim-if.c
parent04f295b64859a6c6b01739fc4dd7fddce42db8d9 (diff)
downloadfsf-binutils-gdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.zip
fsf-binutils-gdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.gz
fsf-binutils-gdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.bz2
Add ABFD argument to sim_open call. Pass through to sim_config so
that image properties such as endianness can be checked. More strongly document the expected behavour of each of the sim_* interfaces. Add default endian argument to simulator config macro SIM_AC_OPTION_ENDIAN. Use in sim_config.
Diffstat (limited to 'sim/m32r/sim-if.c')
-rw-r--r--sim/m32r/sim-if.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index 7e97528..6aab891 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -26,8 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "sim-core.h"
#include "cpu-sim.h"
-struct host_callback_struct *sim_callback;
-
/* Global state until sim_open starts creating and returning it
[and the other simulator i/f fns take it as an argument]. */
struct sim_state sim_global_state;
@@ -38,8 +36,10 @@ STATE current_state;
/* Create an instance of the simulator. */
SIM_DESC
-sim_open (kind, argv)
+sim_open (kind, callback, abfd, argv)
SIM_OPEN_KIND kind;
+ host_callback *callback;
+ struct _bfd *abfd;
char **argv;
{
int i;
@@ -48,7 +48,7 @@ sim_open (kind, argv)
/* FIXME: until we alloc one, use the global. */
memset (sd, 0, sizeof (sim_global_state));
STATE_OPEN_KIND (sd) = kind;
- STATE_CALLBACK (sd) = sim_callback;
+ STATE_CALLBACK (sd) = callback;
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
return 0;
@@ -80,14 +80,10 @@ sim_open (kind, argv)
cgen_init (sd);
/* FIXME:wip */
- sim_core_attach (sd,
- NULL,
- attach_raw_memory,
- access_read_write_exec,
- 0, 0, 0x100000, NULL, NULL);
-
- /* We could only do this if profiling has been enabled, but the
- structure member is small so we don't bother. */
+ sim_core_attach (sd, NULL, attach_raw_memory, access_read_write_exec,
+ 0, 0, M32R_DEFAULT_MEM_SIZE, NULL, NULL);
+
+ /* Only needed for profiling, but the structure member is small. */
for (i = 0; i < MAX_NR_PROCESSORS; ++i)
memset (& CPU_M32R_PROFILE (STATE_CPU (sd, i)), 0,
sizeof (CPU_M32R_PROFILE (STATE_CPU (sd, i))));
@@ -212,17 +208,6 @@ sim_info (sd, verbose)
profile_print (sd, STATE_VERBOSE_P (sd), NULL, print_m32r_misc_cpu);
}
-void
-sim_set_callbacks (sd, p)
- SIM_DESC sd;
- host_callback *p;
-{
- if (sd == NULL)
- sim_callback = p;
- else
- STATE_CALLBACK (sd) = p;
-}
-
/* The contents of BUF are in target byte order. */
void
@@ -300,7 +285,7 @@ sim_read (sd, addr, buf, len)
int len;
{
#if 1
- return sim_core_read_buffer (sd, sim_core_read_map,
+ return sim_core_read_buffer (sd, NULL, sim_core_read_map,
buf, addr, len);
#else
return (*STATE_MEM_READ (sd)) (sd, addr, buf, len);
@@ -315,7 +300,7 @@ sim_write (sd, addr, buf, len)
int len;
{
#if 1
- return sim_core_write_buffer (sd, sim_core_write_map,
+ return sim_core_write_buffer (sd, NULL, sim_core_write_map,
buf, addr, len);
#else
return (*STATE_MEM_WRITE (sd)) (sd, addr, buf, len);