1 /* This file is part of the GDB simulators.
3 Copyright (C) 1997, Free Software Foundation
4 Condtributed by Cyngnus Solutions.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 engine_init (SIM_DESC sd
)
33 memset (&STATE_CPU (sd
, 0)->reg
, 0, sizeof STATE_CPU (sd
, 0)->reg
);
34 memset (&STATE_CPU (sd
, 0)->cia
, 0, sizeof STATE_CPU (sd
, 0)->cia
);
35 CPU_STATE (STATE_CPU (sd
, 0)) = sd
;
39 /* Mechanisms for stopping/restarting the simulation */
42 engine_error (SIM_DESC sd
,
43 instruction_address cia
,
49 sim_io_evprintf (sd
, fmt
, ap
);
54 sim_io_printf (sd
, "\n");
55 engine_halt (sd
, cia
, sim_signalled
, SIGABRT
);
58 sim_io_error (sd
, " - aborting simulation");
62 engine_halt (SIM_DESC sd
,
63 instruction_address cia
,
68 sim_io_error (sd
, "engine_halt - bad longjmp");
70 sd
->siggnal
= siggnal
;
74 longjmp (sd
->path_to_halt
, 1);
78 engine_restart (SIM_DESC sd
,
79 instruction_address cia
)
82 sim_io_error (sd
, "engine_restart - bad longjmp");
85 longjmp(sd
->path_to_restart
, 1);
90 engine_run_until_stop (SIM_DESC sd
,
91 volatile int *keep_running
)
93 if (!setjmp (sd
->path_to_halt
))
95 instruction_address cia
;
97 setjmp (sd
->path_to_restart
);
99 cia
= STATE_CPU (sd
, 0)->cia
;
104 /* anulled instruction */
106 cia
.dp
= cia
.dp
+ sizeof (instruction_word
);
110 instruction_word insn
= IMEM (cia
.ip
);
111 cia
= idecode_issue (sd
, insn
, cia
);
114 while (*keep_running
);
115 engine_halt (sd
, cia
, sim_stopped
, SIGINT
);
This page took 0.031704 seconds and 5 git commands to generate.