aboutsummaryrefslogtreecommitdiff
path: root/sim/tic80
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-09-04 10:08:44 +0000
committerAndrew Cagney <cagney@redhat.com>1997-09-04 10:08:44 +0000
commit6dbaff8f6067e91995adc90e5c8939de41c56e9a (patch)
treef71cef520e051d5d508c23d7b8f7540626c2e97d /sim/tic80
parenta34abff813f4fdd5f289ea45de9e874e31e7edf3 (diff)
downloadgdb-6dbaff8f6067e91995adc90e5c8939de41c56e9a.zip
gdb-6dbaff8f6067e91995adc90e5c8939de41c56e9a.tar.gz
gdb-6dbaff8f6067e91995adc90e5c8939de41c56e9a.tar.bz2
Finish implementation of sim-memopt.
Use in d30v and tic80. Make available a generic sim_read, sim_write implementation.
Diffstat (limited to 'sim/tic80')
-rw-r--r--sim/tic80/ChangeLog6
-rw-r--r--sim/tic80/Makefile.in1
-rw-r--r--sim/tic80/sim-calls.c47
3 files changed, 21 insertions, 33 deletions
diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog
index 6a5102b..eed5ccb 100644
--- a/sim/tic80/ChangeLog
+++ b/sim/tic80/ChangeLog
@@ -1,3 +1,9 @@
+Thu Sep 4 17:45:14 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-calls.c (sim_open): Add memory before parsing arguments.
+ (sim_read): Delete, replace with sim-hrw.
+ (sim_write): Delete, replace with sim-hrw.
+
Thu Sep 4 10:48:57 1997 Andrew Cagney <cagney@b1.cygnus.com>
* sim-calls.c (sim_open): Use sim_do_command to add memory, only
diff --git a/sim/tic80/Makefile.in b/sim/tic80/Makefile.in
index f15b68f..5a0a643 100644
--- a/sim/tic80/Makefile.in
+++ b/sim/tic80/Makefile.in
@@ -16,6 +16,7 @@ SIM_OBJS = sim-endian.o sim-bits.o sim-config.o \
sim-events.o \
sim-core.o \
sim-hload.o \
+ sim-hrw.o \
sim-io.o \
sim-utils.o \
sim-load.o \
diff --git a/sim/tic80/sim-calls.c b/sim/tic80/sim-calls.c
index 7d4c6a9..55f0496 100644
--- a/sim/tic80/sim-calls.c
+++ b/sim/tic80/sim-calls.c
@@ -50,11 +50,25 @@ sim_open (SIM_OPEN_KIND kind,
struct _bfd *abfd,
char **argv)
{
+ char *buf;
SIM_DESC sd = sim_state_alloc (kind, callback);
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
return 0;
+#define TIC80_MEM_START 0x2000000
+#define TIC80_MEM_SIZE 0x100000
+
+ /* main memory */
+ asprintf (&buf, "memory region 0x%lx,0x%lx",
+ TIC80_MEM_START, TIC80_MEM_SIZE);
+ sim_do_command (sd, buf);
+ free (buf);
+ /* interrupt memory */
+ sim_do_command (sd, "memory region 0x1010000,0x1000");
+ /* some memory at zero */
+ sim_do_command (sd, "memory region 0,0x100000");
+
/* getopt will print the error message so we just have to exit if this fails.
FIXME: Hmmm... in the case of gdb we need getopt to call
print_filtered. */
@@ -92,23 +106,6 @@ sim_open (SIM_OPEN_KIND kind,
return 0;
}
-#define TIC80_MEM_START 0x2000000
-#define TIC80_MEM_SIZE 0x100000
-
- if (!STATE_MEMOPT_P (sd))
- {
- char *buf;
- /* main memory */
- asprintf (&buf, "memory region 0x%lx,0x%lx",
- TIC80_MEM_START, TIC80_MEM_SIZE);
- sim_do_command (sd, buf);
- free (buf);
- /* interrupt memory */
- sim_do_command (sd, "memory region 0x1010000,0x1000");
- /* some memory at zero */
- sim_do_command (sd, "memory region 0,0x100000");
- }
-
/* FIXME: for now */
return sd;
}
@@ -123,22 +120,6 @@ sim_close (SIM_DESC sd, int quitting)
}
-int
-sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
-{
- return sim_core_read_buffer (sd, NULL, sim_core_write_map,
- buf, mem, length);
-}
-
-
-int
-sim_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
-{
- return sim_core_write_buffer (sd, NULL, sim_core_write_map,
- buf, mem, length);
-}
-
-
/* FIXME - these magic numbers need to be moved elsewhere */
#define SP_REGNUM 1 /* Contains address of top of stack */