aboutsummaryrefslogtreecommitdiff
path: root/sim/tic80/sim-calls.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-05-19 03:42:33 +0000
committerAndrew Cagney <cagney@redhat.com>1997-05-19 03:42:33 +0000
commitf03b093cd34bc352ad89334a43a34b00a5e5c60c (patch)
treeb9d428d2bdf6dd5f5f5a25a7df7580c3836af9e4 /sim/tic80/sim-calls.c
parent11ab132f168d3c24d4b4d743d86599973b17e3f2 (diff)
downloadgdb-f03b093cd34bc352ad89334a43a34b00a5e5c60c.zip
gdb-f03b093cd34bc352ad89334a43a34b00a5e5c60c.tar.gz
gdb-f03b093cd34bc352ad89334a43a34b00a5e5c60c.tar.bz2
o Implement generic halt/restart/abort module.
Use in tic80 and d30v simulators. o Add signal hook to sim-core module
Diffstat (limited to 'sim/tic80/sim-calls.c')
-rw-r--r--sim/tic80/sim-calls.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/sim/tic80/sim-calls.c b/sim/tic80/sim-calls.c
index dd54184..5b580bd 100644
--- a/sim/tic80/sim-calls.c
+++ b/sim/tic80/sim-calls.c
@@ -80,7 +80,13 @@ sim_open (SIM_OPEN_KIND kind, char **argv)
return 0;
}
- engine_init(&simulation);
+ /* Initialize the main processor */
+ memset (&STATE_CPU (&simulation, 0)->reg, 0, sizeof STATE_CPU (&simulation, 0)->reg);
+ memset (&STATE_CPU (&simulation, 0)->acc, 0, sizeof STATE_CPU (&simulation, 0)->acc);
+ memset (&STATE_CPU (&simulation, 0)->cr, 0, sizeof STATE_CPU (&simulation, 0)->cr);
+ STATE_CPU (&simulation, 0)->is_user_mode = 0;
+ memset (&STATE_CPU (&simulation, 0)->cia, 0, sizeof STATE_CPU (&simulation, 0)->cia);
+ CPU_STATE (STATE_CPU (&simulation, 0)) = &simulation;
#define TIC80_MEM_START 0x2000000
#define TIC80_MEM_SIZE 0x100000
@@ -230,42 +236,6 @@ sim_create_inferior (SIM_DESC sd,
}
-volatile int keep_running = 1;
-
-void
-sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc)
-{
- if (!keep_running)
- {
- *reason = sim_stopped;
- *sigrc = SIGINT;
- keep_running = 1;
- }
- else
- {
- *reason = simulation.reason;
- *sigrc = simulation.siggnal;
- }
-}
-
-
-int
-sim_stop (SIM_DESC sd)
-{
- keep_running = 0;
- return 1;
-}
-
-void
-sim_resume (SIM_DESC sd, int step, int siggnal)
-{
- /* keep_running = 1 - in sim_stop_reason */
- if (step)
- engine_step (sd);
- else
- engine_run_until_stop (sd, &keep_running);
-}
-
void
sim_do_command (SIM_DESC sd, char *cmd)
{